Query regarding the use/limitiations of traits in metaprogramming
I am trying to use traits pattern to assist in metaprogramming.
I have the following problem.
A traits class "trait" defers a decision to another traits class
"trait1" depending
on the result of a third traits class "traita".
However, the compiler does not cooperate.
The code below excutes but gives unexpected output (also shown).
[Note:: The code has been reduced to the minimal to demonstrate the problem.
I have a real task at hand not shown here.]
template <class T>
struct traita { BOOST_STATIC_CONSTANT(int, value=0); };
template <>
struct traita<int> { BOOST_STATIC_CONSTANT(int, value=1); };
template