|
Boost : |
From: Arnau Rossello Castello (arossello_at_[hidden])
Date: 2007-05-29 20:16:56
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk