Boost logo

Boost :

Subject: Re: [boost] [TypeTraits] Type traits for member pointers?
From: Celtic Minstrel (celtic.minstrel.ca_at_[hidden])
Date: 2009-07-17 14:47:17


> see https://svn.boost.org/trac/boost/browser/sandbox/type_traits/boost/type_traits/member_object.hpp
That looks good...

> - however there was no general agreement over nomenclature last time this was raised,
What sort of disagreement?

Anyway, that only satisfies one of the four things I mentioned –
unless I'm misreading it, it is a template to extract Q from "T Q::*".
What about an add_member_ptr, and a remove_member_ptr? So,
add_member_ptr<int,Q>::type would be int Q::*, and
remove_member_ptr<int Q::*>::type would be int.

And there's also no trait for decomposing member functions in the vein
of function_traits. I think it could probably be implemented almost
identically to the existing function_traits template, but with the
addition of another member type which is basically
member_pointer<T>::type.

Another idea is something the checks if a member function is const or
volatile, though that could be done with a combination of is_const or
is_volatile with member_pointer.

Just wondering, why is it necessary to specialize member_pointer for
member function types? After all, in a type "T Q::*" the T could be a
function type "void(int)", which would make the full type
"void(Q::*)(int)", right?

--SPCD
"Celtic Minstrel"


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