
Daniel Walker a écrit :
Why don't we both package what we have, upload to vault, and then work out merging the two and adding the rest in another thread?
I've cleaned-up my files and 'boostified' them so to speak. I've uploaded a 'introspection.zip' on the vault so you can grab it and we can start discussing this in a proper topic ;) Basically i've uploaded the following : BOOST_HAVE_MEMBER_FUNCTION BOOST_HAVE_CONST_MEMBER_FUNCTION BOOST_HAVE_NON_CONST_MEMBER_FUNCTION BOOST_HAVE_MEMBER_DATA Basically, the usage is really simple. You want to check if classes provides a bool is_ok(long) method and you want to catch both const and non-const variations : BOOST_HAVE_MEMBER_FUNCTION(is_ok, bool(long) ) then the check itself is done via : has_member_function<T>::type For BOOST_HAVE_DATA_MEMBER, my method can only check for public members. So I added a macoer called BOOST_INSTROSPECTION_SUPPORT(C,V) that have to be used in user-defined class C that want to publish a member named V to our introspection mecanism. struct foo { private : int mValue; }; struct bar { BOOST_INTROSPECTION_SUPPORT(bar,mValue); private : int mValue; }; BOOST_HAVE_MEMBER_DATA(int, mValue) has_member_data_mValue<foo>::value is false has_member_data_mValue<bar>::value is true Other limitations is that currently you can't have various check for a method with a given name but different signature. I'm working on a fix using PP sequence and : BOOST_HAS_MEMBER_FUNCTION_OVERLOADS(func,(void())(void(int))(void(int,int))) In the same way, checking for suff like operator[] yields invalid class name has_member_function_operator[]. So I propose we hand-code the following : BOOST_HAS_SUBSCRIPT_OPERATOR( void(int) ) that builds a has_subscript_operator<T> class. Other similar operator should be handled the same way.