
30 May
2007
30 May
'07
12:16 a.m.
I've been looking through the documentation of type_traits and function_types(thanks for the tip grafikrobot) trying to find a trait that would let me decompose a pointer to member into the containing class and an independent type, but have found nothing. Is there such a trait somewhere in the boost libs? In case it isn't I offer a small patch for type_traits with the member_pointer_traits template struct, and the corresponding documentation. It is implemented like function_traits, only it's simpler. Briefly the struct has 2 typedefs: member_pointer_traits<int MyClass::*>::class_type yields MyClass member_pointer_traits<int MyClass::*>::member_type yields int -- Arnau