Re: [eigen] Inheritence

[ Thread Index | Date Index | More Archives ]

I think even that example is not perfect. Constructors are not inherited, so you will need to re-declare any constructors you want also. You probably want at least the copy constructor from an arbitrary Eigen matrix type. And operator= is more easily defined with a using statement if you do not need additional behavior from it. I wrote up an example at for a coworker who wanted something like a "templated typedef" over Eigen types. The inheritance approach as you can see is pretty complicated to get right.

Usual caveats about inheriting from STL containers also apply, see for example this thread:


On Thu, Feb 4, 2010 at 2:59 AM, Thomas Capricelli <orzel@xxxxxxxxxxxxxxx> wrote:

It is not recommended, but possible, see

In data giovedì 04 febbraio 2010 06:29:03, Daniel Stonier ha scritto:
> Just a curioisity...are there any ramifications to inheriting vector
> classes? Is it inadvisable for any particular reason?

Mail converted by MHonArc 2.6.19+