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:
Douglas Gregor
2002-07-19 19:17:14 +00:00
parent fca8413df6
commit 97f72b7f8b
2 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -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);
}