[type_traits] data pointers and function pointers

It is difficult in some places in the type_traits documentation to tell when the documentation mentions "pointer" whether this refers to data pointers, function pointers, member data pointers, and/or member function pointers. I assume that if the documentation just refers to "pointer" that it should mean all of the above. But here goes: 1) Does the 'remove_pointer' refer to all of the above ? The examples are only for a single one of the above, a data pointer. 2) The 'is_pointer' doc does say it excludes pointer to members by which I assume this means both member data and member functions. Is there any way to tell whether a pointer is a function pointer or a data pointer by using type_traits since 'is_pointer' includes both ?

BTW - I've turned on verbose linking and here are the library versions I'm linking to: Linking to lib file: libboost_regex-vc80-mt-s-1_40.lib Linking to lib file: libboost_filesystem-vc80-mt-s-1_40.lib Linking to lib file: libboost_system-vc80-mt-s-1_40.lib These libraries are the ones compiled by Boost Consulting, although I got the same error when using my own 1.41 libs compiled with msvc8. Any tips for troubleshooting would be appreciated. Thanks, Sean

It is difficult in some places in the type_traits documentation to tell when the documentation mentions "pointer" whether this refers to data pointers, function pointers, member data pointers, and/or member function pointers. I assume that if the documentation just refers to "pointer" that it should mean all of the above. But here goes:
1) Does the 'remove_pointer' refer to all of the above ? The examples are only for a single one of the above, a data pointer.
It excludes pointers to members, because the result would not be a valid type.
2) The 'is_pointer' doc does say it excludes pointer to members by which I assume this means both member data and member functions. Is there any way to tell whether a pointer is a function pointer or a data pointer by using type_traits since 'is_pointer' includes both ?
is_function

John Maddock wrote:
It is difficult in some places in the type_traits documentation to tell when the documentation mentions "pointer" whether this refers to data pointers, function pointers, member data pointers, and/or member function pointers. I assume that if the documentation just refers to "pointer" that it should mean all of the above. But here goes:
1) Does the 'remove_pointer' refer to all of the above ? The examples are only for a single one of the above, a data pointer.
It excludes pointers to members, because the result would not be a valid type.
Could this please be added to the documentation ? I will make the suggestion on Trac.
2) The 'is_pointer' doc does say it excludes pointer to members by which I assume this means both member data and member functions. Is there any way to tell whether a pointer is a function pointer or a data pointer by using type_traits since 'is_pointer' includes both ?
is_function
::value
Excellent ! Thanks ! Perhaps an is_object_pointer ( data pointer ) and is_function_pointer would be nice in type_traits, as a convenience, as this completes the four specific pointer types along with the already existing is_member_function_pointer and is_member_object_pointer. I'll make the suggestion on Trac.
participants (3)
-
Edward Diener
-
John Maddock
-
Sean Draine