I'm trying to detect at compile time whether a class Foo
or Bar
has either the variable value
or member variable initValue()
.
struct Foo
{
static const int value;
static int initValue();
};
struct Bar
{
};
I've found several boost and boost MPL classes and utils such as BOOST_MPL_HAS_XXX_TRAIT_DEF
and valid_member_metafunction
that appear to do just this but am unsure which to use. I know it's possible to roll out my own detector but I'd rather not.