Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68466 - in sandbox/SOC/2010/phoenix3: boost/phoenix/core boost/phoenix/core/detail boost/phoenix/scope libs/phoenix/test libs/phoenix/test/regression libs/phoenix/test/scope
From: thom.heller_at_[hidden]
Date: 2011-01-27 04:38:38


Author: theller
Date: 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
New Revision: 68466
URL: http://svn.boost.org/trac/boost/changeset/68466

Log:
fixed nullary retrun type calculation, added some tests
Added:
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/regression/
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/regression/bug4853.cpp
      - copied unchanged from r68464, /sandbox/SOC/2010/phoenix3/libs/phoenix/test/bug4853.cpp
Removed:
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/bug4853.cpp
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp | 3 ---
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp | 5 ++++-
   sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp | 3 ++-
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile | 5 +++++
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/bug3289.cpp | 12 ++++++------
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp | 8 ++++----
   6 files changed, 21 insertions(+), 15 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
@@ -142,9 +142,6 @@
             args_type args(this);
             fusion::vector2<args_type&, default_actions> env(args, default_actions());
 
- typedef typename proto::domain_of<actor<Expr> >::type domain_type;
- typedef typename domain_type::proto_grammar grammar_type;
-
             return eval(*this, env);
         }
         

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
@@ -46,7 +46,10 @@
             typedef
                 typename evaluator::impl<
                     Expr const&
- , fusion::vector2<fusion::vector1<const actor<Expr> *>&, default_actions>&
+ , fusion::vector2<
+ fusion::vector1<const ::boost::phoenix::actor<Expr> *>
+ , default_actions
+ >
                   , int
>::result_type
                 type;

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
@@ -183,6 +183,7 @@
                     mpl::true_
                   , detail::scope_is_nullary_actions
>()
+ , int()
             )
>
     {};
@@ -247,7 +248,7 @@
         struct result;
 
         template <typename This, typename Context, typename Lambda>
- struct result<This(Context, Lambda &)>
+ struct result<This(Context, Lambda)>
         {
             typedef
                 typename proto::detail::uncvref<

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
@@ -76,6 +76,7 @@
     [ run scope/lambda_tests.cpp ]
     [ run scope/let_tests.cpp ]
     [ run scope/dynamic_tests.cpp ]
+ [ run scope/bug3289.cpp ]
     [ run scope/bug_000008.cpp : : : $(multi-threading) ]
     ;
 
@@ -117,6 +118,10 @@
     [ run boost_bind_compatibility/bind_test.cpp ]
          ;
 
+test-suite phoenix_regression :
+ [ run regression/bug4853.cpp ]
+ ;
+
 test-suite phoenix_include :
 # [ run include/bind_bind.cpp ]
 # #[ run include/bind_bind_member_function.cpp ]

Deleted: sandbox/SOC/2010/phoenix3/libs/phoenix/test/bug4853.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/bug4853.cpp 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
+++ (empty file)
@@ -1,70 +0,0 @@
-/*==============================================================================
- Copyright (c) 2005-2010 Joel de Guzman
- Copyright (c) 2010 Thomas Heller
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-==============================================================================*/
-
-#include <boost/phoenix/core.hpp>
-#include <boost/phoenix/operator.hpp>
-#include <boost/phoenix/bind.hpp>
-#include <boost/range.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/make_shared.hpp>
-#include <boost/range/adaptor/transformed.hpp>
-#include <boost/range/adaptor/uniqued.hpp>
-#include <boost/range/algorithm_ext/push_back.hpp>
-
-#include <vector>
-#include <string>
-
-
-namespace phoenix = boost::phoenix;
-
-struct Foo {
- Foo(const std::string& name, int value)
- : name_(name)
- , value_(value)
- { }
-
- std::string name_; int value_;
-};
-
-typedef boost::shared_ptr<Foo> FooPtr;
-
-int range_test_complex() {
- typedef std::vector<FooPtr> V;
-
- V source;
-
- source.push_back(boost::make_shared<Foo>("Foo", 10));
- source.push_back(boost::make_shared<Foo>("Bar", 20));
- source.push_back(boost::make_shared<Foo>("Baz", 30));
- source.push_back(boost::make_shared<Foo>("Baz", 30)); //duplicate is here
-
- std::vector<std::string> result1;
- std::vector<int> result2;
-
- using namespace boost::adaptors;
- using phoenix::arg_names::arg1;
-
- boost::push_back(result1, source | transformed(phoenix::bind(&Foo::name_, *arg1)) | uniqued);
-
- for(unsigned i = 0; i < result1.size(); ++i)
- std::cout << result1[i] << "\n";
-
- boost::push_back(result2, source | transformed(phoenix::bind(&Foo::value_, *arg1)) | uniqued);
-
- for(unsigned i = 0; i < result2.size(); ++i)
- std::cout << result2[i] << "\n";
-
- return 0;
-
-}
-
-int main()
-{
- return range_test_complex();
-}
-

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/bug3289.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/bug3289.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/bug3289.cpp 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
@@ -20,15 +20,15 @@
 
 int main()
 {
- std::vector<double> u(11,1.0);
- std::vector<double> w(11,2.0);
- std::vector<double>::const_iterator it=w.begin();
+ std::vector<int> u(11,1);
+ std::vector<int> w(11,2);
+ std::vector<int>::const_iterator it=w.begin();
 
- boost::phoenix::generate(ref(u), lambda(_a=*ref(it)++)[_a*2.0])();
+ boost::phoenix::generate(ref(u), lambda(_a=*ref(it)++)[_a*2])();
 
- BOOST_TEST(std::accumulate(u.begin(), u.end(), 0.0) == 44.0);
+ BOOST_TEST(std::accumulate(u.begin(), u.end(), 0) == 44);
 
- BOOST_TEST(lambda(_a=*ref(it)++)[_a*2.0]()() == 4.0);
+ BOOST_TEST(lambda(_a=*ref(it)++)[_a*2]()() == 4);
     
     return boost::report_errors();
 }

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp 2011-01-27 04:38:32 EST (Thu, 27 Jan 2011)
@@ -77,8 +77,8 @@
 
     {
         int x = 1;
- //int y = lambda[_1]()(x);
- //BOOST_TEST(x == y);
+ int y = lambda[_1]()(x);
+ BOOST_TEST(x == y);
     }
     
     {
@@ -190,8 +190,8 @@
     {
         int i = 0;
         int j = 2;
- //BOOST_TEST(lambda[let(_a = _1)[_a = _2]]()(i, j) == j);
- //BOOST_TEST(i == j);
+ BOOST_TEST(lambda[let(_a = _1)[_a = _2]]()(i, j) == j);
+ BOOST_TEST(i == j);
     }
 
     return boost::report_errors();


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