Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 1.87 KB

is-member-function-pointer-class.md

File metadata and controls

81 lines (62 loc) · 1.87 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: is_member_function_pointer Class
is_member_function_pointer Class
11/04/2016
type_traits/std::is_member_function_pointer
is_member_function_pointer class
is_member_function_pointer
02e372c4-2714-40f2-b376-2e10ca91c8ed

is_member_function_pointer Class

Tests if type is a pointer to member function.

Syntax

template <class Ty>
struct is_member_function_pointer;

Parameters

Ty
The type to query.

Remarks

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

Example

// std__type_traits__is_member_function_pointer.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>

struct trivial
    {
    int val;
    };

struct functional
    {
    int f();
    };

int main()
    {
    std::cout << "is_member_function_pointer<trivial *> == "
        << std::boolalpha
        << std::is_member_function_pointer<trivial *>::value
        << std::endl;
    std::cout << "is_member_function_pointer<int trivial::*> == "
        << std::boolalpha
        << std::is_member_function_pointer<int trivial::*>::value
        << std::endl;
    std::cout << "is_member_function_pointer<int (functional::*)()> == "
        << std::boolalpha
        << std::is_member_function_pointer<int (functional::*)()>::value
        << std::endl;

    return (0);
    }
is_member_function_pointer<trivial *> == false
is_member_function_pointer<int trivial::*> == false
is_member_function_pointer<int (functional::*)()> == true

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
is_member_pointer Class