Numeric range checking

View: New views
2 Messages — Rating Filter:   Alert me  

Numeric range checking

by Dylan Klomparens :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I just started using Spirit 2.1. Is there an equivalent to the general directive "limit_d[P](min, max)" from Spirit v1.8.5? I couldn't find one in the documentation.

-- Dylan

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Spirit-general mailing list
Spirit-general@...
https://lists.sourceforge.net/lists/listinfo/spirit-general

Re: Numeric range checking

by Hartmut Kaiser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I just started using Spirit 2.1. Is there an equivalent to the general
> directive "limit_d[P](min, max)" from Spirit v1.8.5? I couldn't find
> one in the documentation.

No, there isn't. But it's easy enough to emulate:

   qi::int_[qi::pass_ = (qi::_1 >= min && qi::_1 <= max)]

(beware, untested).

Regards Hartmut

-------------------
Meet me at BoostCon
http://boostcon.com




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Spirit-general mailing list
Spirit-general@...
https://lists.sourceforge.net/lists/listinfo/spirit-general