[spirit]why x3::alternative::parse not short-circuited?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[spirit]why x3::alternative::parse not short-circuited?

Boost - Dev mailing list
https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/operator/alternative.hpp#L29

shows both left.parse *and* right.parse are called.
Shouldn't right.parse be skipped if left.parse succeeds?

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

OOPS (was Re: [spirit]why x3::alternative::parse not short-circuited?

Boost - Dev mailing list
On 01/27/2018 12:44 PM, Larry Evans via Boost wrote:
> https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/operator/alternative.hpp#L29 
>
>
> shows both left.parse *and* right.parse are called.
> Shouldn't right.parse be skipped if left.parse succeeds?
>
OOPS.  Never mind.  The c++ compiler does the short circuiting with the
||operator ;(


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost