
18 Jul
2010
18 Jul
'10
3:32 p.m.
Spirit 1.8 has a directive called limit_d which allowed to set the value range. Is there an equivalent for this in Spirit 2.x?
There is not anything like this, but you can achieve the same with a semantic action:
limit_d(min, max)[uint_p]
is equivalent to (when using qi::uint_, qi::_pass, and qi::_1):
uint_[_pass = (min <= _1 && _1 <= max)]
Regards Hartmut
Thanks for the quick reply!
Just out of curiosity: Where can I find this in the documentation? I missed the _pass somehow.
http://www.boost.org/doc/libs/1_43_0/libs/spirit/doc/html/spirit/qi/quick_re ference/phoenix.html Regards Hartmut --------------- Meet me at BoostCon www.boostcon.com