boost metafunction nur instanzieren, wenn eine bestimmte kondition wahr ist?
-
Hallo,
ich habe eine metafunktion, die ich NUR instanzieren möchte, wenn eine bestimmte Kondition wahr ist. Wie geht das?
Danke
class CEmpty { }; template<class Arg> class CMetaFunction { //... typedef typename Arg::test type; } //CMetaFunction<int> soll wirklich nur dann instanziert werden, wenn bCondition_t::value==true typedef mpl::if_<bCondition_t, CMetaFunction<int>,CEmpty>::type test;