Documented use of C++11 lambdas as actions

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@619 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-04-11 16:24:02 +00:00
parent 8a6e38a642
commit c5861a744d

View file

@ -671,6 +671,7 @@ Example :
MOCK_EXPECT( c.method ).throws( std::runtime_error( "error !" ) ); 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( &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( boost::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
} }
[endsect] [endsect]