Skip to content

Commit

Permalink
[phoenix] fixed factorial example
Browse files Browse the repository at this point in the history
[SVN r71870]
  • Loading branch information
sithhell committed May 11, 2011
1 parent edc639a commit b147251
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions example/factorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ struct factorial_impl
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;
Expand All @@ -37,9 +37,10 @@ struct factorial_impl
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;
}

0 comments on commit b147251

Please sign in to comment.