mirror of
https://github.com/boostorg/function.git
synced 2025-07-30 21:07:13 +02:00
Add test/quick.cpp
This commit is contained in:
@ -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>shared $(check14) : return_function_shared_14 ;
|
||||||
run test_return_function.cpp return_function/<cxxstd>14 : : : <link>static $(check14) : return_function_static_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
21
test/quick.cpp
Normal 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();
|
||||||
|
}
|
Reference in New Issue
Block a user