std::is_member_pointer in C++ with Examples Last Updated : 12 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The std::is_member_pointer template of C++ STL is present in the <type_traits> header file. The std::is_member_pointer template of C++ STL is used to check whether the T is a pointer to non-static member or not. It return the boolean value true if T is a pointer to non-static member type, Otherwise return false. Header File: #include<type_traits> Template Class: template<class T> struct is_member_pointer : std::integral_constant < bool, is_member_object_pointer<T>::value || is_member_function_pointer<T>::value> {}; Syntax: std::is_member_pointer::value Parameters: The template std::is_member_pointer accepts a single parameter T(Trait class) to check whether T is pointer to non-static member or not. Return Value: This template returns a boolean variable as shown below: True: If the type T is pointer to non-static member. False: If the type T is not a pointer to non-static member. Below is the program to illustrates the std::is_member_pointer template in C/C++: Program: CPP // C++ program to illustrate // std::is_member_pointer #include <bits/stdc++.h> #include <type_traits> using namespace std; // Driver Code int main() { // Empty Class GFG class GFG { }; // Check if GFG::* is a member // pointer or not bool a = is_member_pointer<int(GFG::*)>::value; if (a) { cout << "GFG::* is a Member Pointer!" << endl; } else { cout << "GFG::* is not a Member Pointer!" << endl; } // Check if int is a member // pointer or not a = is_member_pointer<int(int)>::value; if (a) { cout << "int is a Member Pointer!" << endl; } else { cout << "int is not a Member Pointer!" << endl; } return 0; } Output: GFG::* is a Member Pointer! int is not a Member Pointer! Reference: http://www.cplusplus.com/reference/type_traits/is_member_pointer/ Comment More infoAdvertise with us Next Article std::is_member_pointer in C++ with Examples B bansal_rtk_ Follow Improve Article Tags : Misc C++ CPP-Functions Practice Tags : CPPMisc Similar Reads std::is_member_object_pointer template in C++ with Examples The std::is_member_object_pointer template of C++ STL is present in the <type_traits> header file. The std::is_member_object_pointer template of C++ STL is used to check whether the T is a pointer to non-static data member object or not. It return the boolean value true if T is a pointer to no 2 min read std::is_member_function_pointer template in C++ with Examples The std::is_member_function_pointer template of C++ STL is present in the <type_traits> header file. The std::is_member_function_pointer template of C++ STL is used to check whether the T is a pointer to non-static member function or not. It return the boolean value true if T is pointer to non 2 min read std::is_literal_type in C++ with Examples The std::is_literal_type template of C++ STL is present in the <type_traits> header file. The std::is_literal_type template of C++ STL is used to check whether the T is literal type or not. It return the boolean value true if T is literal type, otherwise return false. Header File: #include< 2 min read std::is_same template in C++ with Examples The std::is_same template of C++ STL is present in the <type_traits> header file. The std::is_same template of C++ STL is used to check whether the type A is same type as of B or not. It return the boolean value true if both are same, otherwise return false. Header File: #include<type_trait 3 min read std::add_lvalue_reference in C++ with Examples The std::add_lvalue_reference template of C++ STL is present in the <type_traits> header file. The std::add_lvalue_reference template of C++ STL is used to get lvalue reference type that refers to T type. An lvalue reference is formed by placing an '&' after some type. An rvalue reference 2 min read Like