Boost logo

Boost Users :

Subject: [Boost-users] [MPL] Generate template instantiation ?
From: Olivier Tournaire (olitour_at_[hidden])
Date: 2008-10-06 12:59:55

Hi all,

I have a class templated on 2 arguments, e.g. :

template <typename PixelType , typename NbChannels> class myClass
    // ...

This class is in a lib, and I would like to instantiate it for all base type
(signed char, unsigned char, int, unsigned int ...), and for a given number
of channels. For example :

template class myClass<unsigned char,1>;
template class myClass<unsigned char,2>;
// ...
template class myClass<unsigned char,10>;

template class myClass<signed char,1>;
template class myClass<signed char,2>;
// ...
template class myClass<signed char,10>;

And so on. Is there a way to do this without writing all possiblities. Maybe
with the MPL ?

Best regards,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at