Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71870 - trunk/libs/phoenix/example
From: thom.heller_at_[hidden]
Date: 2011-05-11 10:45:34


Author: theller
Date: 2011-05-11 10:45:30 EDT (Wed, 11 May 2011)
New Revision: 71870
URL: http://svn.boost.org/trac/boost/changeset/71870

Log:
[phoenix] fixed factorial example
Text files modified:
   trunk/libs/phoenix/example/factorial.cpp | 7 ++++---
   1 files changed, 4 insertions(+), 3 deletions(-)

Modified: trunk/libs/phoenix/example/factorial.cpp
==============================================================================
--- trunk/libs/phoenix/example/factorial.cpp (original)
+++ trunk/libs/phoenix/example/factorial.cpp 2011-05-11 10:45:30 EDT (Wed, 11 May 2011)
@@ -15,12 +15,12 @@
     template <typename Sig>
     struct result;
     
- template <typename Arg>
+ template <typename This, typename Arg>
     struct result<This(Arg)>
         : result<This(Arg const &)>
     {};
 
- template <typename Arg>
+ template <typename This, typename Arg>
     struct result<This(Arg &)>
     {
         typedef Arg type;
@@ -37,9 +37,10 @@
 int
 main()
 {
+ using boost::phoenix::arg_names::arg1;
     boost::phoenix::function<factorial_impl> factorial;
- using namespace boost::phoenix::arg_names::arg1;
     int i = 4;
+ std::cout << factorial(i)() << std::endl;
     std::cout << factorial(arg1)(i) << std::endl;
     return 0;
 }


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