Add test/quick.cpp

This commit is contained in:
Peter Dimov
2019-01-07 00:02:14 +02:00
parent 3f6b2b6f56
commit 6d811a2e72
2 changed files with 23 additions and 0 deletions

View File

@ -71,3 +71,5 @@ run test_return_function.cpp return_function/<cxxstd>0x : : : <link>static : ret
run test_return_function.cpp return_function/<cxxstd>14 : : : <link>shared $(check14) : return_function_shared_14 ;
run test_return_function.cpp return_function/<cxxstd>14 : : : <link>static $(check14) : return_function_static_14 ;
run quick.cpp ;

21
test/quick.cpp Normal file
View File

@ -0,0 +1,21 @@
// Copyright 2019 Peter Dimov
// Use, modification and distribution is subject to the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
#include <boost/function.hpp>
#include <boost/core/lightweight_test.hpp>
static int f( int x )
{
return x + 1;
}
int main()
{
boost::function<int(int)> fn( f );
BOOST_TEST_EQ( fn( 5 ), 6 );
return boost::report_errors();
}