Add test_return_function

This commit is contained in:
Peter Dimov
2018-11-14 00:11:27 +02:00
parent b6b0568c88
commit 17716b63f2
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
// Copyright 2018 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
#include <boost/function.hpp>
#include <boost/core/lightweight_test.hpp>
//
boost::function<int(int, int)> get_fn_1();
boost::function2<int, int, int> get_fn_2();
//
int main()
{
BOOST_TEST_EQ( get_fn_1()( 1, 2 ), 3 );
BOOST_TEST_EQ( get_fn_2()( 1, 2 ), 3 );
return boost::report_errors();
}