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
17template<class T> void test( T const &, int i )
18{
19 BOOST_TEST_EQ( boost::is_placeholder<T>::value, i );
20}
21
22int main()
23{
24 using namespace boost::placeholders;
25
26 test( _1, i: 1 );
27 test( _2, i: 2 );
28 test( _3, i: 3 );
29 test( _4, i: 4 );
30 test( _5, i: 5 );
31 test( _6, i: 6 );
32 test( _7, i: 7 );
33 test( _8, i: 8 );
34 test( _9, i: 9 );
35
36 return boost::report_errors();
37}
38

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