1 | #include <boost/config.hpp> |
2 | |
3 | #if defined(BOOST_MSVC) |
4 | #pragma warning(disable: 4786) // identifier truncated in debug info |
5 | #pragma warning(disable: 4710) // function not inlined |
6 | #pragma warning(disable: 4711) // function selected for automatic inline expansion |
7 | #pragma warning(disable: 4514) // unreferenced inline removed |
8 | #endif |
9 | |
10 | // |
11 | // bind_unary_addr.cpp |
12 | // |
13 | // Copyright (c) 2005 Peter Dimov |
14 | // |
15 | // Distributed under the Boost Software License, Version 1.0. (See |
16 | // accompanying file LICENSE_1_0.txt or copy at |
17 | // http://www.boost.org/LICENSE_1_0.txt) |
18 | // |
19 | |
20 | #include <boost/bind/bind.hpp> |
21 | |
22 | // |
23 | |
24 | class X |
25 | { |
26 | private: |
27 | |
28 | void operator& (); |
29 | void operator& () const; |
30 | |
31 | public: |
32 | |
33 | void operator()() |
34 | { |
35 | } |
36 | |
37 | void operator()() const |
38 | { |
39 | } |
40 | |
41 | void operator()(int) |
42 | { |
43 | } |
44 | |
45 | void operator()(int) const |
46 | { |
47 | } |
48 | |
49 | void operator()(int, int) |
50 | { |
51 | } |
52 | |
53 | void operator()(int, int) const |
54 | { |
55 | } |
56 | |
57 | void operator()(int, int, int) |
58 | { |
59 | } |
60 | |
61 | void operator()(int, int, int) const |
62 | { |
63 | } |
64 | |
65 | void operator()(int, int, int, int) |
66 | { |
67 | } |
68 | |
69 | void operator()(int, int, int, int) const |
70 | { |
71 | } |
72 | |
73 | void operator()(int, int, int, int, int) |
74 | { |
75 | } |
76 | |
77 | void operator()(int, int, int, int, int) const |
78 | { |
79 | } |
80 | |
81 | void operator()(int, int, int, int, int, int) |
82 | { |
83 | } |
84 | |
85 | void operator()(int, int, int, int, int, int) const |
86 | { |
87 | } |
88 | |
89 | void operator()(int, int, int, int, int, int, int) |
90 | { |
91 | } |
92 | |
93 | void operator()(int, int, int, int, int, int, int) const |
94 | { |
95 | } |
96 | |
97 | void operator()(int, int, int, int, int, int, int, int) |
98 | { |
99 | } |
100 | |
101 | void operator()(int, int, int, int, int, int, int, int) const |
102 | { |
103 | } |
104 | |
105 | void operator()(int, int, int, int, int, int, int, int, int) |
106 | { |
107 | } |
108 | |
109 | void operator()(int, int, int, int, int, int, int, int, int) const |
110 | { |
111 | } |
112 | }; |
113 | |
114 | template<class F> void test_const( F const & f ) |
115 | { |
116 | f(); |
117 | } |
118 | |
119 | template<class F> void test( F f ) |
120 | { |
121 | f(); |
122 | test_const( f ); |
123 | } |
124 | |
125 | int main() |
126 | { |
127 | test( f: boost::bind<void>( f: X() ) ); |
128 | test( f: boost::bind<void>( f: X(), a1: 1 ) ); |
129 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2 ) ); |
130 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3 ) ); |
131 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3, a4: 4 ) ); |
132 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3, a4: 4, a5: 5 ) ); |
133 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3, a4: 4, a5: 5, a6: 6 ) ); |
134 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3, a4: 4, a5: 5, a6: 6, a7: 7 ) ); |
135 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3, a4: 4, a5: 5, a6: 6, a7: 7, a8: 8 ) ); |
136 | test( f: boost::bind<void>( f: X(), a1: 1, a2: 2, a3: 3, a4: 4, a5: 5, a6: 6, a7: 7, a8: 8, a9: 9 ) ); |
137 | |
138 | return 0; |
139 | } |
140 | |