Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64294 - in sandbox/SOC/2010/phoenix3: boost/phoenix/core libs/phoenix/test/core
From: thom.heller_at_[hidden]
Date: 2010-07-23 07:59:31


Author: theller
Date: 2010-07-23 07:59:30 EDT (Fri, 23 Jul 2010)
New Revision: 64294
URL: http://svn.boost.org/trac/boost/changeset/64294

Log:
val(foo) fixed
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp | 17 ++++++++++++++++-
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp | 9 ++++++---
   2 files changed, 22 insertions(+), 4 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp 2010-07-23 07:59:30 EDT (Fri, 23 Jul 2010)
@@ -76,8 +76,23 @@
         }
     };
 
+ namespace detail
+ {
+ template <typename T>
+ struct convert_value
+ {
+ typedef T type;
+ };
+
+ template <typename T, int N>
+ struct convert_value<T[N]>
+ {
+ typedef T const* type;
+ };
+ }
+
     template <typename T>
- struct make_value : compose<value, T> {};
+ struct make_value : compose<value, typename detail::convert_value<T>::type> {};
 
     template <typename Actor>
     struct make_actor_value : compose<actor_value, Actor> {};

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp 2010-07-23 07:59:30 EDT (Fri, 23 Jul 2010)
@@ -13,6 +13,7 @@
 using boost::phoenix::cref;
 using boost::phoenix::ref;
 using boost::phoenix::val;
+using boost::phoenix::arg_names::_1;
 using boost::phoenix::arg_names::arg1;
 using boost::phoenix::arg_names::arg2;
 
@@ -36,10 +37,12 @@
     BOOST_TEST(&(arg1(c1)) == &c1); // must be an lvalue
 
     // value
- //cout << val("Hello,")(0) << val(' ')(0) << val("World")(0) << endl;
+ val(' ')();
+ val(" ")();
+ std::cout << val("Hello,")() << val(' ')() << val("World")() << std::endl;
     BOOST_TEST(val(3)() == 3);
- //BOOST_TEST(val("Hello, world")(0) == std::string("Hello, world"));
- //BOOST_TEST(val(_1)(i1) == i1);
+ BOOST_TEST(val("Hello, world")() == std::string("Hello, world"));
+ BOOST_TEST(val(_1)(i1) == i1);
 
     // should not compile:
 #ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST


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