placeholder_const_ref_test.cpp 758 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #include <boost/bind/placeholders.hpp>
  11. #include <boost/is_placeholder.hpp>
  12. #include <boost/core/lightweight_test.hpp>
  13. //
  14. template<class T> void test( T const &, int i )
  15. {
  16. BOOST_TEST_EQ( boost::is_placeholder<T>::value, i );
  17. }
  18. int main()
  19. {
  20. using namespace boost::placeholders;
  21. test( _1, 1 );
  22. test( _2, 2 );
  23. test( _3, 3 );
  24. test( _4, 4 );
  25. test( _5, 5 );
  26. test( _6, 6 );
  27. test( _7, 7 );
  28. test( _8, 8 );
  29. test( _9, 9 );
  30. return boost::report_errors();
  31. }