You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++17 has std::conjunction/disjunction which are very similar to our
`all_of_t` and `any_of_t` in practice. (They can differ if you pass in
a Predicate with a non-bool ::value, but we don't do that).
Essentially `detail::all_of_t<P, T...>` is equivalent to
`std::conjunction<P<T>...>`, and `any_of_t<P, T...>` corresponds to
`std::disjunction<P<T>...>`.
Unlike `any`/`all_of_t`, `dis`/`conjunction` aren't tied to a single
predicate, so it can be used as a compile-time `and` across multiple
types with `::value`s, allowing some nice reduction in code in a few
places.
I also removed the `count_t` since `any_of_t` and `all_of_t` was the
only thing using it.
This commit also uses aliases to the `std` implementations for C++14/17
features when under the appropriate compiler mode, as we were already
doing for a few things (like index_sequence). Most of these aren't
saving much (the implementation for enable_if_t, for example, is
trivial), but I think it makes the intention of the code instantly
clear.
Since this introduces a slightly different implementation when compiling
under C++17, I've also added a travis-ci build to compile in C++17 mode
under gcc 6. (I tried adding an experimental build with a recent gcc 7
snapshot, but pybind triggers an ICE in c++17 mode with the current g++
snapshot.)
0 commit comments