quick.cpp 516 B

123456789101112131415161718192021222324252627
  1. //
  2. // quick.cpp - a quick test for boost/bind.hpp
  3. //
  4. // Copyright 2017 Peter Dimov
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. //
  8. // See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt
  10. //
  11. #include <boost/bind.hpp>
  12. #include <boost/core/lightweight_test.hpp>
  13. int f( int a, int b, int c )
  14. {
  15. return a + 10 * b + 100 * c;
  16. }
  17. int main()
  18. {
  19. int const i = 1;
  20. BOOST_TEST_EQ( boost::bind( f, _1, 2, 3 )( i ), 321 );
  21. return boost::report_errors();
  22. }