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
operator ()()33 void operator()()
34 {
35 }
36
operator ()() const37 void operator()() const
38 {
39 }
40
operator ()(int)41 void operator()(int)
42 {
43 }
44
operator ()(int) const45 void operator()(int) const
46 {
47 }
48
operator ()(int,int)49 void operator()(int, int)
50 {
51 }
52
operator ()(int,int) const53 void operator()(int, int) const
54 {
55 }
56
operator ()(int,int,int)57 void operator()(int, int, int)
58 {
59 }
60
operator ()(int,int,int) const61 void operator()(int, int, int) const
62 {
63 }
64
operator ()(int,int,int,int)65 void operator()(int, int, int, int)
66 {
67 }
68
operator ()(int,int,int,int) const69 void operator()(int, int, int, int) const
70 {
71 }
72
operator ()(int,int,int,int,int)73 void operator()(int, int, int, int, int)
74 {
75 }
76
operator ()(int,int,int,int,int) const77 void operator()(int, int, int, int, int) const
78 {
79 }
80
operator ()(int,int,int,int,int,int)81 void operator()(int, int, int, int, int, int)
82 {
83 }
84
operator ()(int,int,int,int,int,int) const85 void operator()(int, int, int, int, int, int) const
86 {
87 }
88
operator ()(int,int,int,int,int,int,int)89 void operator()(int, int, int, int, int, int, int)
90 {
91 }
92
operator ()(int,int,int,int,int,int,int) const93 void operator()(int, int, int, int, int, int, int) const
94 {
95 }
96
operator ()(int,int,int,int,int,int,int,int)97 void operator()(int, int, int, int, int, int, int, int)
98 {
99 }
100
operator ()(int,int,int,int,int,int,int,int) const101 void operator()(int, int, int, int, int, int, int, int) const
102 {
103 }
104
operator ()(int,int,int,int,int,int,int,int,int)105 void operator()(int, int, int, int, int, int, int, int, int)
106 {
107 }
108
operator ()(int,int,int,int,int,int,int,int,int) const109 void operator()(int, int, int, int, int, int, int, int, int) const
110 {
111 }
112 };
113
test_const(F const & f)114 template<class F> void test_const( F const & f )
115 {
116 f();
117 }
118
test(F f)119 template<class F> void test( F f )
120 {
121 f();
122 test_const( f );
123 }
124
main()125 int main()
126 {
127 test( boost::bind<void>( X() ) );
128 test( boost::bind<void>( X(), 1 ) );
129 test( boost::bind<void>( X(), 1, 2 ) );
130 test( boost::bind<void>( X(), 1, 2, 3 ) );
131 test( boost::bind<void>( X(), 1, 2, 3, 4 ) );
132 test( boost::bind<void>( X(), 1, 2, 3, 4, 5 ) );
133 test( boost::bind<void>( X(), 1, 2, 3, 4, 5, 6 ) );
134 test( boost::bind<void>( X(), 1, 2, 3, 4, 5, 6, 7 ) );
135 test( boost::bind<void>( X(), 1, 2, 3, 4, 5, 6, 7, 8 ) );
136 test( boost::bind<void>( X(), 1, 2, 3, 4, 5, 6, 7, 8, 9 ) );
137
138 return 0;
139 }
140