From 040e568f037d909ce1461d460b59cdcdb08464f3 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Mon, 26 Jul 2010 06:00:45 +0000 Subject: [PATCH] minor tweaks [SVN r64347] --- test/function/function_tests.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test/function/function_tests.cpp b/test/function/function_tests.cpp index a0a0e6f..5fc6420 100644 --- a/test/function/function_tests.cpp +++ b/test/function/function_tests.cpp @@ -28,9 +28,9 @@ struct sqr_impl struct result; template - struct result + struct result { - typedef Arg type; + typedef typename boost::remove_reference::type type; }; template @@ -49,9 +49,9 @@ struct fact_impl struct result; template - struct result + struct result { - typedef Arg type; + typedef typename boost::remove_reference::type type; }; template @@ -71,9 +71,9 @@ struct pow_impl struct result; template - struct result + struct result { - typedef Arg1 type; + typedef typename boost::remove_reference::type type; }; template @@ -92,9 +92,9 @@ struct add_impl struct result; template - struct result + struct result { - typedef Arg1 type; + typedef typename boost::remove_reference::type type; }; template @@ -124,6 +124,9 @@ main() BOOST_TEST((sqr(arg1) + 5)(i5) == ((i5*i5)+5)); BOOST_TEST(add(arg1, arg1, arg1, arg1)(i5) == (5+5+5+5)); + // testing composition + BOOST_TEST(add(arg1, arg1, arg1, power(arg1, 2))(i5) == (5+5+5+25)); + int const ic5 = 5; // testing consts BOOST_TEST(sqr(arg1)(ic5) == (ic5*ic5));