mirror of
https://github.com/boostorg/bind.git
synced 2026-01-26 01:02:28 +01:00
bind(type<R>(), f, ...) alternative syntax support.
[SVN r15928]
This commit is contained in:
@@ -190,12 +190,31 @@ void function_object_test()
|
||||
|
||||
#if !defined(__MWERKS__) || (__MWERKS__ > 0x2406) // Fails for this version of the compiler.
|
||||
|
||||
global_result = 0;
|
||||
bind<void>(Y(), i, _1, 9, 4)(k);
|
||||
BOOST_TEST( global_result == 4938 );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void function_object_test2()
|
||||
{
|
||||
using namespace boost;
|
||||
|
||||
short i(6);
|
||||
|
||||
int const k = 3;
|
||||
|
||||
BOOST_TEST( bind(type<short>(), Y(), ref(i))() == 7 );
|
||||
BOOST_TEST( bind(type<short>(), Y(), ref(i))() == 8 );
|
||||
BOOST_TEST( bind(type<int>(), Y(), i, _1)(k) == 38 );
|
||||
BOOST_TEST( bind(type<long>(), Y(), i, _1, 9)(k) == 938 );
|
||||
|
||||
global_result = 0;
|
||||
bind(type<void>(), Y(), i, _1, 9, 4)(k);
|
||||
BOOST_TEST( global_result == 4938 );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
|
||||
@@ -487,6 +506,7 @@ int main()
|
||||
{
|
||||
function_test();
|
||||
function_object_test();
|
||||
function_object_test2();
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
|
||||
adaptable_function_object_test();
|
||||
|
||||
Reference in New Issue
Block a user