diff --git a/test/function_arith_cxx98.cpp b/test/function_arith_cxx98.cpp index 59fc701..65ea0a7 100644 --- a/test/function_arith_cxx98.cpp +++ b/test/function_arith_cxx98.cpp @@ -7,20 +7,22 @@ float mul_ints(int x, int y) { return ((float)x) * y; } + +struct int_div { + float operator()(int x, int y) const { return ((float)x)/y; }; +}; + + int main() { boost::function f; -struct int_div { - float operator()(int x, int y) const { return ((float)x)/y; }; -}; - f = int_div(); -std::cout << f(5, 3) >> std::endl; +std::cout << f(5, 3) << std::endl; if (f) @@ -34,5 +36,4 @@ f = 0; f = &mul_ints; - } - \ No newline at end of file +} diff --git a/test/function_arith_portable.cpp b/test/function_arith_portable.cpp index e007a32..0f43f61 100644 --- a/test/function_arith_portable.cpp +++ b/test/function_arith_portable.cpp @@ -6,20 +6,21 @@ float mul_ints(int x, int y) { return ((float)x) * y; } + +struct int_div { + float operator()(int x, int y) const { return ((float)x)/y; }; +}; + int main() { boost::function2 f; -struct int_div { - float operator()(int x, int y) const { return ((float)x)/y; }; -}; - f = int_div(); -std::cout << f(5, 3) >> std::endl; +std::cout << f(5, 3) << std::endl; if (f) @@ -34,4 +35,3 @@ f = 0; f = &mul_ints; } - \ No newline at end of file diff --git a/test/function_ref_cxx98.cpp b/test/function_ref_cxx98.cpp index a9b07b4..8327ccb 100644 --- a/test/function_ref_cxx98.cpp +++ b/test/function_ref_cxx98.cpp @@ -4,7 +4,7 @@ #include -struct stateful_type { int operator(int) const { return 0; } }; +struct stateful_type { int operator()(int) const { return 0; } }; int main() { @@ -16,4 +16,3 @@ int main() boost::function f2(f); } - \ No newline at end of file diff --git a/test/function_ref_portable.cpp b/test/function_ref_portable.cpp index 2fe925d..86801a7 100644 --- a/test/function_ref_portable.cpp +++ b/test/function_ref_portable.cpp @@ -4,7 +4,7 @@ #include -struct stateful_type { int operator(int) const { return 0; } }; +struct stateful_type { int operator()(int) const { return 0; } }; int main() { @@ -16,4 +16,3 @@ int main() boost::function1 f2(f); } - \ No newline at end of file diff --git a/test/lambda_test.cpp b/test/lambda_test.cpp index 7b9e396..da919af 100644 --- a/test/lambda_test.cpp +++ b/test/lambda_test.cpp @@ -22,7 +22,7 @@ int test_main(int, char*[]) function f2 = bind(f1, false, _1); function f3 = bind(f2, 4.0); - unsigned result = f3(); + f3(); return 0; } diff --git a/test/mem_fun_cxx98.cpp b/test/mem_fun_cxx98.cpp index 17f98c3..2fc327e 100644 --- a/test/mem_fun_cxx98.cpp +++ b/test/mem_fun_cxx98.cpp @@ -9,6 +9,8 @@ struct X { int foo(int); }; +int X::foo(int x) { return -x; } + int main() { @@ -20,4 +22,3 @@ X x; f(&x, 5); } - \ No newline at end of file diff --git a/test/mem_fun_portable.cpp b/test/mem_fun_portable.cpp index c90f9ee..95fd9c7 100644 --- a/test/mem_fun_portable.cpp +++ b/test/mem_fun_portable.cpp @@ -9,6 +9,8 @@ struct X { int foo(int); }; +int X::foo(int x) { return -x; } + int main() { @@ -20,4 +22,3 @@ X x; f(&x, 5); } - \ No newline at end of file diff --git a/test/stateless_test.cpp b/test/stateless_test.cpp index 4912823..aec9913 100644 --- a/test/stateless_test.cpp +++ b/test/stateless_test.cpp @@ -21,7 +21,7 @@ struct stateless_integer_add { int operator()(int x, int y) const { return x+y; } - void* operator new(std::size_t, stateless_integer_add*) + void* operator new(std::size_t, stateless_integer_add*) throw() { throw std::runtime_error("Cannot allocate a stateless_integer_add"); return 0; // suppress warnings diff --git a/test/std_bind_cxx98.cpp b/test/std_bind_cxx98.cpp index 35ebc85..e8b318c 100644 --- a/test/std_bind_cxx98.cpp +++ b/test/std_bind_cxx98.cpp @@ -9,6 +9,8 @@ struct X { int foo(int); }; +int X::foo(int x) { return -x; } + int main() { @@ -19,4 +21,3 @@ int main() f(5); // Call x.foo(5) } - \ No newline at end of file diff --git a/test/std_bind_portable.cpp b/test/std_bind_portable.cpp index 696d58f..418d03b 100644 --- a/test/std_bind_portable.cpp +++ b/test/std_bind_portable.cpp @@ -9,6 +9,8 @@ struct X { int foo(int); }; +int X::foo(int x) { return -x; } + int main() { @@ -19,4 +21,3 @@ int main() f(5); // Call x.foo(5) } - \ No newline at end of file diff --git a/test/sum_avg_cxx98.cpp b/test/sum_avg_cxx98.cpp index d41d8b4..c18fa5a 100644 --- a/test/sum_avg_cxx98.cpp +++ b/test/sum_avg_cxx98.cpp @@ -21,4 +21,3 @@ boost::function sum_avg; sum_avg = &do_sum_avg; } - \ No newline at end of file diff --git a/test/sum_avg_portable.cpp b/test/sum_avg_portable.cpp index 54158e5..6e6518d 100644 --- a/test/sum_avg_portable.cpp +++ b/test/sum_avg_portable.cpp @@ -21,4 +21,3 @@ boost::function4 sum_avg; sum_avg = &do_sum_avg; } - \ No newline at end of file