
If there's already a boost solution for this, then I have egg on my face, but I can't find one:
I'd like an MPL macro that defines a predicate template which inherits from boost::true_type iff the given type defines *any* member with a particular name (false_type otherwise), and which does not assume the member name exists, like this:
struct my_class {
// foo might be member data, member function, a typedef, etc:
int foo;
};
CREATE_MEMBER_CHECK(foo);
CREATE_MEMBER_CHECK(bar);
has_member_foo