Boost logo

Boost Users :

Subject: Re: [Boost-users] MPL - what rule am I breaking?
From: Eric Niebler (eric_at_[hidden])
Date: 2009-03-06 14:06:16


Noah Roberts wrote:
> template < typename FIELD, bool Writable >
> struct rec
<snip>

> template < typename VEC >
> struct generate_record
> : boost::mpl::inherit_linearly< VEC, boost::mpl::inherit< rec<pl::_2,
> true>, pl::_1> >::type
<snip>

The problem is the "bool Writable" non-type template parameter. The MPL
lambda expression evaluator can't handle that. Change it to this:

   template<typename Field, typename Writable>
   struct rec

and then

   template < typename VEC >
   struct generate_record
     : boost::mpl::inherit_linearly< VEC, boost::mpl::inherit<
rec<pl::_2, mpl::true_>, pl::_1> >::type

HTH,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net