blob: e0bd2291cc594a6855aae7b144b47a59db5bb7cd [file] [log] [blame]
Brian Silvermance4aa8d2018-08-04 23:36:03 -07001#include <boost/config.hpp>
2
3#if defined( BOOST_MSVC )
4
5#pragma warning(disable: 4786) // identifier truncated in debug info
6#pragma warning(disable: 4710) // function not inlined
7#pragma warning(disable: 4711) // function selected for automatic inline expansion
8#pragma warning(disable: 4514) // unreferenced inline removed
9
10#endif
11
12// bind_rvalue_test.cpp
13//
14// Copyright (c) 2006 Peter Dimov
15//
16// Distributed under the Boost Software License, Version 1.0.
17//
18// See accompanying file LICENSE_1_0.txt or copy at
19// http://www.boost.org/LICENSE_1_0.txt)
20
21#include <boost/bind.hpp>
22
23#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
24#pragma warning(push, 3)
25#endif
26
27#include <iostream>
28
29#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
30#pragma warning(pop)
31#endif
32
33#include <boost/detail/lightweight_test.hpp>
34
35//
36
37int f( int x )
38{
39 return x;
40}
41
42int main()
43{
44 BOOST_TEST(
45 boost::bind( f, _1 )
46 ( 1 ) == 1 );
47
48 BOOST_TEST(
49 boost::bind( f, _2 )
50 ( 1, 2 ) == 2 );
51
52 BOOST_TEST(
53 boost::bind( f, _3 )
54 ( 1, 2, 3 ) == 3 );
55
56 BOOST_TEST(
57 boost::bind( f, _4 )
58 ( 1, 2, 3, 4 ) == 4 );
59
60 BOOST_TEST(
61 boost::bind( f, _5 )
62 ( 1, 2, 3, 4, 5 ) == 5 );
63
64 BOOST_TEST(
65 boost::bind( f, _6 )
66 ( 1, 2, 3, 4, 5, 6 ) == 6 );
67
68 BOOST_TEST(
69 boost::bind( f, _7 )
70 ( 1, 2, 3, 4, 5, 6, 7 ) == 7 );
71
72 BOOST_TEST(
73 boost::bind( f, _8 )
74 ( 1, 2, 3, 4, 5, 6, 7, 8 ) == 8 );
75
76 BOOST_TEST(
77 boost::bind( f, _9 )
78 ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) == 9 );
79
80 return boost::report_errors();
81}