mirror of
https://github.com/boostorg/lambda2.git
synced 2025-05-12 06:01:41 +00:00
Add test/lookup_problem.cpp
This commit is contained in:
parent
1424e6ea62
commit
b89df4b867
@ -18,3 +18,4 @@ project : requirements
|
|||||||
run quick.cpp ;
|
run quick.cpp ;
|
||||||
run lambda2_test.cpp ;
|
run lambda2_test.cpp ;
|
||||||
run version.cpp ;
|
run version.cpp ;
|
||||||
|
run lookup_problem.cpp ;
|
||||||
|
24
test/lookup_problem.cpp
Normal file
24
test/lookup_problem.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/lambda2.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
namespace N
|
||||||
|
{
|
||||||
|
struct Irrelevant {};
|
||||||
|
void operator+( Irrelevant, Irrelevant );
|
||||||
|
|
||||||
|
int plus_one( int i )
|
||||||
|
{
|
||||||
|
using namespace boost::lambda2;
|
||||||
|
return (_1 + 1)( i );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_EQ( plus_one( 4 ), 5 );
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user