• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 //  placeholder_const_ref_test.cpp - forming a const& to _1
3 //
4 //  Copyright 2015 Peter Dimov
5 //
6 //  Distributed under the Boost Software License, Version 1.0.
7 //  See accompanying file LICENSE_1_0.txt or copy at
8 //  http://www.boost.org/LICENSE_1_0.txt
9 //
10 
11 #include <boost/bind/placeholders.hpp>
12 #include <boost/is_placeholder.hpp>
13 #include <boost/core/lightweight_test.hpp>
14 
15 //
16 
test(T const &,int i)17 template<class T> void test( T const &, int i )
18 {
19     BOOST_TEST_EQ( boost::is_placeholder<T>::value, i );
20 }
21 
main()22 int main()
23 {
24     using namespace boost::placeholders;
25 
26     test( _1, 1 );
27     test( _2, 2 );
28     test( _3, 3 );
29     test( _4, 4 );
30     test( _5, 5 );
31     test( _6, 6 );
32     test( _7, 7 );
33     test( _8, 8 );
34     test( _9, 9 );
35 
36     return boost::report_errors();
37 }
38