Brian Silverman | 4a2409e | 2018-08-04 23:24:02 -0700 | [diff] [blame^] | 1 | [/ |
| 2 | Copyright 2007 John Maddock. |
| 3 | Distributed under the Boost Software License, Version 1.0. |
| 4 | (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | http://www.boost.org/LICENSE_1_0.txt). |
| 6 | ] |
| 7 | |
| 8 | [section:is_member_function_pointer is_member_function_pointer] |
| 9 | template <class T> |
| 10 | struct is_member_function_pointer : public __tof {}; |
| 11 | |
| 12 | __inherit If T is a (possibly cv-qualified) pointer to a member function |
| 13 | then inherits from __true_type, |
| 14 | otherwise inherits from __false_type. |
| 15 | |
| 16 | __std_ref 3.9.2 and 8.3.3. |
| 17 | |
| 18 | [all_compilers] |
| 19 | |
| 20 | __header ` #include <boost/type_traits/is_member_function_pointer.hpp>` or ` #include <boost/type_traits.hpp>` |
| 21 | |
| 22 | __examples |
| 23 | |
| 24 | [:`is_member_function_pointer<int (MyClass::*)(void)>` inherits from `__true_type`.] |
| 25 | |
| 26 | [:`is_member_function_pointer<int (MyClass::*)(char)>::type` is the type `__true_type`.] |
| 27 | |
| 28 | [:`is_member_function_pointer<int (MyClass::*)(void)const>::value` is an integral constant |
| 29 | expression that evaluates to /true/.] |
| 30 | |
| 31 | [:`is_member_function_pointer<int (MyClass::*)>::value` is an integral constant |
| 32 | expression that evaluates to /false/: the argument in this case is a pointer to |
| 33 | a data member and not a member function, see __is_member_object_pointer |
| 34 | and __is_member_pointer] |
| 35 | |
| 36 | [:`is_member_function_pointer<T>::value_type` is the type `bool`.] |
| 37 | |
| 38 | [endsect] |
| 39 | |