Re: [Boost-users] templates w/ non-type arguments

I realize my question was not complete! Is it possible to write the 3 x 3 x 3 explicit instantiations, not with 27 lines of code, but perhaps in some kind of loop? Rds, -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Michael Gopshtein Sent: 15 January 2008 08:51 To: boost-users@lists.boost.org Subject: Re: [Boost-users] templates w/ non-type arguments "Hicham Mouline" <hicham@mouline.org> wrote in message news:20080114191355.0EA71200C2@ws6-7.us4.outblaze.com...
Hello,
I have: enum ParamType { FLAT, CURVE1D, CURVE2D };
template<ParamType r, ParamType q, ParamType v> class TIP: { };
I would like to explicitly write all the possible full specializations of TIP... template class TIP<FLAT, FLAT, FLAT>;
template<> class TIP<FLAT, FLAT, FLAT> {}; template<> class TIP<FLAT, FLAT, CURVE1D> {}; etc.
...
regards,

AMDG Hicham Mouline wrote:
I realize my question was not complete! Is it possible to write the 3 x 3 x 3 explicit instantiations, not with 27 lines of code, but perhaps in some kind of loop?
#include <boost/preprocessor/seq/for_each_product.hpp> #include <boost/preprocessor/seq/enum.hpp> #define PARAMS (FLAT)(CURVE1D)(CURVE2D) #define M(r, x) template class TIP<BOOST_PP_SEQ_ENUM(x)> {}; BOOST_PP_SEQ_FOR_EACH_PRODUCT(M, (PARAMS)(PARAMS)(PARAMS)) In Christ, Steven Watanabe
participants (2)
-
Hicham Mouline
-
Steven Watanabe