Alan M. Carroll wrote:
I must be missing something obvious, or Boost.Mpl doesn't work on MSVC 7.1.
I'm working on my container class C
. Using MPL I've defined a class static bool IS_OUTER which, if true, means that PAYLOADhas a typedef for the name "key_type". If IS_OUTER is false, then PAYLOADmay not have such a typedef (and in my test case, it doesn't). What I want to do, in C, is have a typedef that is PAYLOAD::key_type if IS_OUTER is true and just plain PAYLOAD if IS_OUTER is false. I cannot make it work. I've checked IS_OUTER and it has the correct value. But no matter what combination of if_c, eval_if_c, apply, etc. I use it won't compile because "'key_type' : is not a member of". Here's my basic example without the elaboration: typedef typename boost::mpl::if_c
::type testing;
That can't work. All the template arguments to boost::mpl::if_c must be
syntactically valid after substiution of C's template parameters, and
clearly that won't be the case. I think you need to write your own
selection template:
template