-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variadic and_/or_ [Feature Request] #251
Comments
This looks interesting, if you do a pull request we will have a look at it. Any other comment? |
This probably isn't the most efficient algorithm, since I believe it will automatically make |
could be made much more efficient using a recursive alias and fast tracking, you could even theoretically backfill since there is an identity value |
|
@Alexhuszagh more thorough explanation of back filling and recursive aliases here http://odinthenerd.blogspot.de/2017/03/backfilled-join-why-kvasir-mpl-is.html |
essentially the algorithms any and all are variadic and_ and or_ operations if you use identity as a predicate. In kvasir::mpl all and any are implemented in terms of find_if in order to allow short circuiting which is actually quite fast. One could also implement and_ and or_ in terms of find_if as well. |
@odinthenerd I'll read through your blog thoroughly tonight (and others) since I'm less familiar with highly efficient TMP and therefore back-filling and recursive aliases, and then update my PR accordingly. Thanks for the immensely helpful comments. |
While porting boost::mpl code to Brigand, I noticed that although
and_
andor_
exist, they only support 2 arguments.It's fairly easy to versions taking a variadic parameter pack, using template specialization, without adding much code bloat.
And
Or
If there's any interest, I can make a pull request. Thanks for the excellent library.
The text was updated successfully, but these errors were encountered: