1 /*==============================================================================
2     Copyright (c) 2005 Peter Dimov
3     Copyright (c) 2005-2010 Joel de Guzman
4     Copyright (c) 2010 Thomas Heller
5 
6     Distributed under the Boost Software License, Version 1.0. (See accompanying
7     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9 
10 #include <boost/config.hpp>
11 
12 #if defined(BOOST_MSVC)
13 #pragma warning(disable: 4786)  // identifier truncated in debug info
14 #pragma warning(disable: 4710)  // function not inlined
15 #pragma warning(disable: 4711)  // function selected for automatic inline expansion
16 #pragma warning(disable: 4514)  // unreferenced inline removed
17 #endif
18 
19 #include <boost/phoenix/core.hpp>
20 #include <boost/phoenix/bind.hpp>
21 
22 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
23 #pragma warning(push, 3)
24 #endif
25 
26 #include <iostream>
27 
28 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
29 #pragma warning(pop)
30 #endif
31 
32 class X
33 {
34 private:
35 
36     void operator& ();
37     void operator& () const;
38 
39 public:
40 
41     typedef void result_type;
42 
operator ()()43     void operator()()
44     {
45     }
46 
operator ()() const47     void operator()() const
48     {
49     }
50 
operator ()(int)51     void operator()(int)
52     {
53     }
54 
operator ()(int) const55     void operator()(int) const
56     {
57     }
58 
operator ()(int,int)59     void operator()(int, int)
60     {
61     }
62 
operator ()(int,int) const63     void operator()(int, int) const
64     {
65     }
66 
operator ()(int,int,int)67     void operator()(int, int, int)
68     {
69     }
70 
operator ()(int,int,int) const71     void operator()(int, int, int) const
72     {
73     }
74 
operator ()(int,int,int,int)75     void operator()(int, int, int, int)
76     {
77     }
78 
operator ()(int,int,int,int) const79     void operator()(int, int, int, int) const
80     {
81     }
82 
operator ()(int,int,int,int,int)83     void operator()(int, int, int, int, int)
84     {
85     }
86 
operator ()(int,int,int,int,int) const87     void operator()(int, int, int, int, int) const
88     {
89     }
90 
operator ()(int,int,int,int,int,int)91     void operator()(int, int, int, int, int, int)
92     {
93     }
94 
operator ()(int,int,int,int,int,int) const95     void operator()(int, int, int, int, int, int) const
96     {
97     }
98 
operator ()(int,int,int,int,int,int,int)99     void operator()(int, int, int, int, int, int, int)
100     {
101     }
102 
operator ()(int,int,int,int,int,int,int) const103     void operator()(int, int, int, int, int, int, int) const
104     {
105     }
106 
operator ()(int,int,int,int,int,int,int,int)107     void operator()(int, int, int, int, int, int, int, int)
108     {
109     }
110 
operator ()(int,int,int,int,int,int,int,int) const111     void operator()(int, int, int, int, int, int, int, int) const
112     {
113     }
114 
operator ()(int,int,int,int,int,int,int,int,int)115     void operator()(int, int, int, int, int, int, int, int, int)
116     {
117     }
118 
operator ()(int,int,int,int,int,int,int,int,int) const119     void operator()(int, int, int, int, int, int, int, int, int) const
120     {
121     }
122 };
123 
test_const(F const & f)124 template<class F> void test_const( F const & f )
125 {
126     f();
127 }
128 
test(F f)129 template<class F> void test( F f )
130 {
131     f();
132     test_const( f );
133 }
134 
main()135 int main()
136 {
137     using boost::phoenix::bind;
138 
139     test( bind( X() ) );
140     test( bind( X(), 1 ) );
141     test( bind( X(), 1, 2 ) );
142     test( bind( X(), 1, 2, 3 ) );
143     test( bind( X(), 1, 2, 3, 4 ) );
144     test( bind( X(), 1, 2, 3, 4, 5 ) );
145     test( bind( X(), 1, 2, 3, 4, 5, 6 ) );
146     test( bind( X(), 1, 2, 3, 4, 5, 6, 7 ) );
147     test( bind( X(), 1, 2, 3, 4, 5, 6, 7, 8 ) );
148     test( bind( X(), 1, 2, 3, 4, 5, 6, 7, 8, 9 ) );
149 
150     return 0;
151 }
152