Add test/lookup_problem.cpp

This commit is contained in:
Peter Dimov 2021-06-27 03:54:42 +03:00
parent 1424e6ea62
commit b89df4b867
2 changed files with 25 additions and 0 deletions

View File

@ -18,3 +18,4 @@ project : requirements
run quick.cpp ;
run lambda2_test.cpp ;
run version.cpp ;
run lookup_problem.cpp ;

24
test/lookup_problem.cpp Normal file
View 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();
}