diff --git a/test/mem_fun_cxx98.cpp b/test/mem_fun_cxx98.cpp index afded46..fba21dd 100644 --- a/test/mem_fun_cxx98.cpp +++ b/test/mem_fun_cxx98.cpp @@ -10,22 +10,28 @@ #include +#include #include #include struct X { int foo(int); + std::ostream& foo2(std::ostream&) const; }; int X::foo(int x) { return -x; } +std::ostream& X::foo2(std::ostream& x) const { return x; } int main() { boost::function f; + boost::function f2; -f = &X::foo; - -X x; -f(&x, 5); + f = &X::foo; + f2 = &X::foo2; - return 0; + X x; + BOOST_TEST(f(&x, 5) == -5); + BOOST_TEST(f2(&x, boost::ref(std::cout)) == std::cout); + + return ::boost::report_errors(); } diff --git a/test/mem_fun_portable.cpp b/test/mem_fun_portable.cpp index 689eb22..b0dcd14 100644 --- a/test/mem_fun_portable.cpp +++ b/test/mem_fun_portable.cpp @@ -10,22 +10,28 @@ #include +#include #include #include struct X { int foo(int); + std::ostream& foo2(std::ostream&) const; }; int X::foo(int x) { return -x; } +std::ostream& X::foo2(std::ostream& x) const { return x; } int main() { boost::function2 f; + boost::function2 f2; -f = &X::foo; - -X x; -f(&x, 5); + f = &X::foo; + f2 = &X::foo2; - return 0; + X x; + BOOST_TEST(f(&x, 5) == -5); + BOOST_TEST(f2(&x, boost::ref(std::cout)) == std::cout); + + return ::boost::report_errors(); }