Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit] Equivalent of limit_d in spirit 2.x
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2010-07-18 10:06:43


> 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

---------------
Meet me at BoostCon
www.boostcon.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