|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64347 - sandbox/SOC/2010/phoenix3/libs/phoenix/test/function
From: thom.heller_at_[hidden]
Date: 2010-07-26 02:00:47
Author: theller
Date: 2010-07-26 02:00:45 EDT (Mon, 26 Jul 2010)
New Revision: 64347
URL: http://svn.boost.org/trac/boost/changeset/64347
Log:
minor tweaks
Text files modified:
sandbox/SOC/2010/phoenix3/libs/phoenix/test/function/function_tests.cpp | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/function/function_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/function/function_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/function/function_tests.cpp 2010-07-26 02:00:45 EDT (Mon, 26 Jul 2010)
@@ -28,9 +28,9 @@
struct result;
template <typename This, typename Arg>
- struct result<This(Arg &)>
+ struct result<This(Arg)>
{
- typedef Arg type;
+ typedef typename boost::remove_reference<Arg>::type type;
};
template <typename Arg>
@@ -49,9 +49,9 @@
struct result;
template <typename This, typename Arg>
- struct result<This(Arg &)>
+ struct result<This(Arg)>
{
- typedef Arg type;
+ typedef typename boost::remove_reference<Arg>::type type;
};
template <typename Arg>
@@ -71,9 +71,9 @@
struct result;
template <typename This, typename Arg1, typename Arg2>
- struct result<This(Arg1 &, Arg2 &)>
+ struct result<This(Arg1, Arg2)>
{
- typedef Arg1 type;
+ typedef typename boost::remove_reference<Arg1>::type type;
};
template <typename Arg1, typename Arg2>
@@ -92,9 +92,9 @@
struct result;
template <typename This, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
- struct result<This(Arg1&, Arg2&, Arg3&, Arg4&)>
+ struct result<This(Arg1, Arg2, Arg3, Arg4)>
{
- typedef Arg1 type;
+ typedef typename boost::remove_reference<Arg1>::type type;
};
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4>
@@ -124,6 +124,9 @@
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));
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk