1#include <boost/config.hpp>
2
3//
4// bind_type_test.cpp
5//
6// Copyright (c) 2015 Peter Dimov
7//
8// Distributed under the Boost Software License, Version 1.0.
9// See accompanying file LICENSE_1_0.txt or copy at
10// http://www.boost.org/LICENSE_1_0.txt
11//
12
13#include <boost/bind/bind.hpp>
14#include <boost/core/lightweight_test.hpp>
15
16using namespace boost::placeholders;
17
18//
19
20template<int I> struct X
21{
22};
23
24void fv1( X<1> )
25{
26}
27
28void fv2( X<1>, X<2> )
29{
30}
31
32void fv3( X<1>, X<2>, X<3> )
33{
34}
35
36void fv4( X<1>, X<2>, X<3>, X<4> )
37{
38}
39
40void fv5( X<1>, X<2>, X<3>, X<4>, X<5> )
41{
42}
43
44void fv6( X<1>, X<2>, X<3>, X<4>, X<5>, X<6> )
45{
46}
47
48void fv7( X<1>, X<2>, X<3>, X<4>, X<5>, X<6>, X<7> )
49{
50}
51
52void fv8( X<1>, X<2>, X<3>, X<4>, X<5>, X<6>, X<7>, X<8> )
53{
54}
55
56void fv9( X<1>, X<2>, X<3>, X<4>, X<5>, X<6>, X<7>, X<8>, X<9> )
57{
58}
59
60void test()
61{
62 boost::bind( f: fv1, a1: _1 )( X<1>() );
63 boost::bind( f: fv2, a1: _1, a2: _2 )( X<1>(), X<2>() );
64 boost::bind( f: fv3, a1: _1, a2: _2, a3: _3 )( X<1>(), X<2>(), X<3>() );
65 boost::bind( f: fv4, a1: _1, a2: _2, a3: _3, a4: _4 )( X<1>(), X<2>(), X<3>(), X<4>() );
66 boost::bind( f: fv5, a1: _1, a2: _2, a3: _3, a4: _4, a5: _5 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>() );
67 boost::bind( f: fv6, a1: _1, a2: _2, a3: _3, a4: _4, a5: _5, a6: _6 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>() );
68 boost::bind( f: fv7, a1: _1, a2: _2, a3: _3, a4: _4, a5: _5, a6: _6, a7: _7 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>(), X<7>() );
69 boost::bind( f: fv8, a1: _1, a2: _2, a3: _3, a4: _4, a5: _5, a6: _6, a7: _7, a8: _8 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>(), X<7>(), X<8>() );
70 boost::bind( f: fv9, a1: _1, a2: _2, a3: _3, a4: _4, a5: _5, a6: _6, a7: _7, a8: _8, a9: _9 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>(), X<7>(), X<8>(), X<9>() );
71}
72
73int main()
74{
75 test();
76 return boost::report_errors();
77}
78

source code of boost/libs/bind/test/bind_type_test.cpp