[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] StdVector
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Tue, 21 Apr 2009 18:47:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.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=0OaJSVxS4QA3Nc6+vGe4o+Lv9b6WKCU5iNYoYut0+Z8=; b=BhwqjsPExpK09F96vJwdYwc8GQvsVRuujzQpvzvaZkjXSfjvTiaf34HFCT4SLwz8Ol 0RoskETLtgIAgkBLJ3HJg+ODT8OwtcA9ioT9v8sW794gmzURSDg7RtQatFNn9WHhcNb+ pSfmHdiGDgxEMGLO2ejnDWyE5FDd/aL9dTOxw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=et/2IxWtgZFSWiMjbmXwj83V/qYVZ1JQcjzfPBx1L6TQP9YRh1hRGXZoaQy4oVXB+H jbVMm8c9gg97O91Vlsqiazkl/AVxPIi5LUxUFzEfCUiwVJaVT1r3hmWdt/rH1yF2cMUp 0zi1x/wwZMLZX9B80/GZ/jn7JDFjTIa6os0sg=
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