Use a template parameter in a preprocessor directive?
- by Ranju V
Is it possible to use a non-type constant template parameter in a preprocessor directive? Here's what I have in mind:
template <int DING>
struct Foo
{
enum { DOO = DING };
};
template <typename T>
struct Blah
{
void DoIt()
{
#if (T::Doo & 0x010)
// somecode here
#endif
}
};
When I try…