[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Inheritence
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 5 Feb 2010 03:02:15 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TsrrXX4rcvbiE8dcK9eWYoXs1heuCDmRmFk1Ju+Skxo=; b=RdRzlnpgSlj3zb0Lhn4hqhwRWRyBbCr4VH0xmKt0f/AByzXLoj0jt5xZ1leKRXTLfv FHdiILY3T5Nywh8uGYFL0gDuk6SuY68FNZS/zX8nIVYhQFNRNVhMRAPAtjQ7VIlLi8YT fTiMni1MaYy2L/SphFxJC9Ov50fU/b0NFXBEc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=exsyBAt0dDA9uQ23V1QDfqtI2bQYsg0UgX9UnqmqhyBvOrl1bpofZwIU+xG9l3xQ2a 5NccR6xi/Bes1j6lFrFHBI/BCnjkR98tlShaDwPDdFwmg+n/g8BkIGGqRoplYqavVHR3 7HSJMGTU4ADx8Y4vLNS3jDPi1uEdjDWkvAvWs=
You would for example have to if some function taking a T& tried to
use ei_traits<T>::Flags, and then you pass an object of your derived
class to that function.
However, I can't think of a valid case for a function to do that.
Instead of using ei_traits<T>::Flags, it should use T::Flags. So if
you remember what triggered a compilation error when not specializing
ei_traits, please tell me.
ei_traits is only there as a forward-declaration trick for CRTP
classes. It is only an internal device.
2010/2/5 Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>:
> Well actually, i remember that in some cases i needed to define the ei_traits (i have it in a #if 0/#endif in my code), but i couldn't say which case :/..... just that right now, i dont need for my use case
> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
> In data venerdì 05 febbraio 2010 08:02:52, Benoit Jacob ha scritto:
>> MyMatrix inherit Matrix which inherits MatrixBase<Matrix>.
>> So whenever an object of class MyMatrix is seen as a MatrixBase, it is
>> a MatrixBase<Matrix> so it uses ei_traits<Matrix>.
>> So, forget my recommendation about ei_traits.