]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/function_types/test/classification/is_member_pointer.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / function_types / test / classification / is_member_pointer.cpp
CommitLineData
7c673cae
FG
1
2// (C) Copyright Tobias Schwinger
3//
4// Use modification and distribution are subject to the boost Software License,
5// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
6
7//------------------------------------------------------------------------------
8
9#include <boost/mpl/assert.hpp>
10#include <boost/function_types/is_member_pointer.hpp>
11
12namespace ft = boost::function_types;
13
14typedef void func();
15typedef void (*func_ptr)();
16typedef void (&func_ref)();
17class C;
18typedef void (C::*mem_func_ptr)();
19typedef void (C::*c_mem_func_ptr)() const;
20typedef void (C::*v_mem_func_ptr)() volatile;
21typedef void (C::*cv_mem_func_ptr)() const volatile;
22typedef int C::*mem_ptr;
23
24
25BOOST_MPL_ASSERT_NOT((
26 ft::is_member_pointer< func >
27));
28
29BOOST_MPL_ASSERT_NOT((
30 ft::is_member_pointer< func_ptr >
31));
32
33BOOST_MPL_ASSERT_NOT((
34 ft::is_member_pointer< func_ref >
35));
36
37BOOST_MPL_ASSERT((
38 ft::is_member_pointer< mem_func_ptr >
39));
40
41BOOST_MPL_ASSERT((
42 ft::is_member_pointer< c_mem_func_ptr >
43));
44
45BOOST_MPL_ASSERT((
46 ft::is_member_pointer< v_mem_func_ptr >
47));
48
49BOOST_MPL_ASSERT((
50 ft::is_member_pointer< cv_mem_func_ptr >
51));
52
53BOOST_MPL_ASSERT((
54 ft::is_member_pointer< mem_ptr >
55));
56
57BOOST_MPL_ASSERT_NOT((
58 ft::is_member_pointer< func_ptr* >
59));
60
61BOOST_MPL_ASSERT_NOT((
62 ft::is_member_pointer< mem_func_ptr* >
63));
64
65BOOST_MPL_ASSERT_NOT((
66 ft::is_member_pointer< mem_ptr* >
67));
68
69BOOST_MPL_ASSERT_NOT((
70 ft::is_member_pointer< C >
71));
72
73BOOST_MPL_ASSERT_NOT((
74 ft::is_member_pointer< int >
75));
76
77BOOST_MPL_ASSERT_NOT((
78 ft::is_member_pointer< int* >
79));
80
81BOOST_MPL_ASSERT_NOT((
82 ft::is_member_pointer< int** >
83));
84
85BOOST_MPL_ASSERT_NOT((
86 ft::is_member_pointer< int& >
87));
88