test_return_function.cpp 404 B

123456789101112131415161718192021
  1. // Copyright 2018 Peter Dimov.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. #include <boost/function.hpp>
  4. #include <boost/core/lightweight_test.hpp>
  5. //
  6. boost::function<int(int, int)> get_fn_1();
  7. boost::function2<int, int, int> get_fn_2();
  8. //
  9. int main()
  10. {
  11. BOOST_TEST_EQ( get_fn_1()( 1, 2 ), 3 );
  12. BOOST_TEST_EQ( get_fn_2()( 1, 2 ), 3 );
  13. return boost::report_errors();
  14. }