Brad Austin wrote:
I wrote:
I recently purchased David Abrahams' and Aleksey Gurtovoy's new book on the MPL, "C++ Template Metaprogramming" (obviously recently since it's only been out a couple of weeks), and am working through some of the examples. I'm having trouble with the factorial example in section 8.3.1, page 160:
#include
#include #include #include #include #include namespace mpl = boost::mpl;
template <class N> struct factorial : mpl::eval_if< mpl::equal_to
> // check N == 0 , mpl::int_<1> // 0! == 1 , mpl::multiplies< // N! == N * (N-1)! N , factorial > > { BOOST_STATIC_ASSERT(N::value >= 0); // for nonnegative N };
With the modified include directive, the code compiles fine for me on GCC (MinGW) 3.2.x, 3.3.x and 3.4.x.
Anyway, is this mailing list an appropriate place to bring up issues like this? I know David and Aleksey are members, but I'm not clear on whether their book qualifies as an official Boost product.
This is as good a place as any to bring up the question. You posted on a weekend; now that it's over you should get an anser soon. Jonathan