
30 Jul
2009
30 Jul
'09
10 a.m.
Hello, I have BOOST_HAS_STATIC_MEMBER_DATA(size_t, maxsize) // from introspection in sandbox template <typename T> class C { static const size_t s = boost::mpl::eval_if< boost::introspection::has_static_member_data_maxsize<T>, boost::mpl::size_t<T::maxsize>, boost::mpl::size_t<0> >::value; }; if T has maxsize size_t member, then s should get maxsize and if it doesn't, s should be 0. I get a compile error for cases where T doesn't have maxsize, because I still refer to it. e.g. of T struct Texample { ... static const size_t maxsize = 5; }; Regards,