Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2000-09-14 02:16:32


Some of the code I write for Boost involves member pointers and
operator->*(), but I worry about not being prepared for smart
pointers-to-members. Shouldn't we come up with some sort of traits system
for member pointers? Remember that we have to do stuff for data member
pointers (MT T::*) and function member pointers (RT (T::*)(long)).

Maybe something like (a quick mock-up):

template <typename T>
struct data_member_traits
{
    typedef typename T::class_type class_type;
    typedef typename T::member_type member_type;
};

template <class T, typename MT>
struct data_member_traits<MT T::*>
{
    typedef T class_type;
    typedef MT member_type;
};

template <typename T>
struct function_member_traits
{
    typedef typename T::class_type class_type;
    typedef typename T::member_type member_type;

    // Other stuff
    // Result type
    // Argument types (if any)
    // A "const" method or not
    // ...
}

-- 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk