forked from boostorg/function
Don't try to use function types inline for those silly compilers that can't handle it (e.g., Borland C++ 5.5.1)
[SVN r14534]
This commit is contained in:
@ -84,7 +84,8 @@ test_main(int, char*[])
|
||||
fv = &do_nothing;
|
||||
fv.clear();
|
||||
|
||||
function<int (int, int), empty_function_policy, empty_function_mixin,
|
||||
typedef int Ftype(int, int);
|
||||
function<Ftype, empty_function_policy, empty_function_mixin,
|
||||
counting_allocator<int> > f2;
|
||||
alloc_count = 0;
|
||||
dealloc_count = 0;
|
||||
|
@ -647,10 +647,12 @@ test_new_syntax()
|
||||
v2();
|
||||
|
||||
BOOST_TEST(global_int == 5);
|
||||
function<string (const string& x, const string& y)> cat(&string_cat);
|
||||
typedef string Fcat(const string& x, const string& y);
|
||||
function<Fcat> cat(&string_cat);
|
||||
BOOST_TEST(cat("str", "ing") == "string");
|
||||
|
||||
function<int (short lhs, short rhs)> sum(&sum_ints);
|
||||
typedef int Fsum(short lhs, short rhs);
|
||||
function<Fsum> sum(&sum_ints);
|
||||
BOOST_TEST(sum(2, 3) == 5);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user