Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

is_member_pointer Class

Tests if type is a pointer to member.

template<class Ty>
    struct is_member_pointer;

Ty

The type to query.

An instance of the type predicate holds true if the type Ty is a pointer to member function or a pointer to member object, or a cv-qualified form of one of them, otherwise it holds false.

 

// std_tr1__type_traits__is_member_pointer.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
struct trivial 
    { 
    int val; 
    }; 
 
struct functional 
    { 
    int f(); 
    }; 
 
int main() 
    { 
    std::cout << "is_member_pointer<trivial *> == " 
        << std::boolalpha 
        << std::is_member_pointer<trivial *>::value 
        << std::endl; 
    std::cout << "is_member_pointer<int trivial::*> == " 
        << std::boolalpha 
        << std::is_member_pointer<int trivial::*>::value 
        << std::endl; 
    std::cout << "is_member_pointer<int (functional::*)()> == " 
        << std::boolalpha 
        << std::is_member_pointer<int (functional::*)()>::value 
        << std::endl; 
 
    return (0); 
    } 
 
is_member_pointer<trivial *> == false
is_member_pointer<int trivial::*> == true
is_member_pointer<int (functional::*)()> == true

Header: <type_traits>

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft