mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Replace Boost.Bind by std::bind and lambdas
This commit is contained in:
parent
35e43d58a6
commit
a426e02759
9 changed files with 28 additions and 41 deletions
|
|
@ -572,7 +572,7 @@ bool custom_constraint( int expected, int actual )
|
|||
BOOST_AUTO_TEST_CASE( demonstrates_adding_a_custom_constraint_with_boost_bind )
|
||||
{
|
||||
mock_class c;
|
||||
MOCK_EXPECT( c.method ).with( boost::bind( &custom_constraint, 42, _1 ) );
|
||||
MOCK_EXPECT( c.method ).with( std::bind( &custom_constraint, 42, _1 ) );
|
||||
}
|
||||
//]
|
||||
}
|
||||
|
|
@ -722,7 +722,7 @@ BOOST_AUTO_TEST_CASE( demonstrates_configuring_actions )
|
|||
MOCK_EXPECT( c.method ).moves( 42 ); // returns by moving the value
|
||||
MOCK_EXPECT( c.method ).throws( std::runtime_error( "error !" ) );
|
||||
MOCK_EXPECT( c.method ).calls( &function ); // forwards 'method' parameter to 'function'
|
||||
MOCK_EXPECT( c.method ).calls( boost::bind( &function, 42 ) ); // drops 'method' parameter and binds 42 as parameter to 'function'
|
||||
MOCK_EXPECT( c.method ).calls( std::bind( &function, 42 ) ); // drops 'method' parameter and binds 42 as parameter to 'function'
|
||||
MOCK_EXPECT( c.method ).calls( []( int i ) { return i; } ); // uses a C++11 lambda
|
||||
}
|
||||
//]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue