Re: [eigen] StdVector

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Tue, Apr 21, 2009 at 12:54 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:

> EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_TPL_<N>(ClassName,
> Type1,Name1,Type2,Name2,Type3,Name3,...));
>
>  If we don't want to define one macro per number of template
> arguments, we have to use some advanced meta-preprocessor tricks. For
> instance the API could be:
>
> EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_TPL(ClassName, NbTplParams,
> (Type1,Name1,Type2,Name2,Type3,Name3,...)));

I just stumbled, over variadic macros. You can (afaik also under GCC)
do something like this

EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_TPL(...) \
__VA_ARGS__ m;

This does obviously not create a specialization but it declares a
variable and works with

EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_TPL( Eigen::Matrix<double,3,3> )

This would make things easier and would not require tricky
meta-processor tricks.

- Hauke



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/