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
|
|
@ -24,8 +24,8 @@ namespace
|
|||
//[ invoke_functor_solution
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
#include <boost/bind/apply.hpp>
|
||||
#include <turtle/mock.hpp>
|
||||
#include <functional>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ namespace
|
|||
BOOST_AUTO_TEST_CASE( how_to_invoke_a_functor_passed_as_parameter_of_a_mock_method )
|
||||
{
|
||||
mock_class mock;
|
||||
MOCK_EXPECT( mock.method ).calls( boost::bind( boost::apply< void >(), _1, 42 ) ); // whenever 'method' is called, invoke the functor with 42
|
||||
MOCK_EXPECT( mock.method ).calls( [](const auto &functor){ functor(42); } ); // whenever 'method' is called, invoke the functor with 42
|
||||
function( mock );
|
||||
}
|
||||
//]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue