
On Wednesday, April 13, 2011 05:10:12 PM Robert Jones wrote:
I'm a newbie to Phoenix, just exploring, but I guess my intent in this code is obvious. Can anyone tell me what I'm doing wrong?
Thx
- Rob.
#include <iostream> #include
#include #include #include using namespace boost::phoenix; using namespace boost::phoenix::arg_names; using namespace std;
int main() { boost::function
factorial; factorial = if_else( _1 == 0, 1, _1 * factorial( _1 - 1 ) ); cout << factorial( 3 ) << endl;
return 0; }
DISCLAIMER: The following is undocumented, might not work and is subject to
change without notice.
Phoenix V3 (from trunk) has experimental support for recursing into itself:
#include