Re: [eigen] StdVector

[ Thread Index | Date Index | More Archives ]

I am glad that this discussion has been initiated. As mentioned in my last e-mail regarding the MSVC patch (ei_workaround_msvc_std_vector) for StdVector it is not even compiling (in some cases) because the patch does not deal with the fact that constructors are not inherited and ei_workaround_msvc_std_vector only contains a default and copy constructor.

Another proposal: enforce the user to write:

How do you want to do that? Do you want to enforce it programatically like e.g.

    template <>
    class vector< Eigen::Matrix< double, 3, 1 > > {

or do you want to 'enforce' via documentation? I would vote for enforcing it programtically...

std::vector<MyTrickyType,Eigen::aligned_allocator<MyTrickyType> > ....;

with a specialization of std::vector for Eigen::aligned_allocator<> to
workaround the resize() issue

In my opinion this is the best solution since we would get rid of deriving from std::std_vector which on top of other things mentioned in this thread is causing additional problems in MSVC.

Well, I am not an STL specialist but since the alignment issue also holds for other STL containers I just started wondering... what about specializing std::allocator for the required Eigen types? In the end we are talking about the default allocator for a specific type and in case of fixed size Eigen types this should be the aligned_allocator...


Mail converted by MHonArc 2.6.19+