-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
While porting boost::mpl code to Brigand, I noticed that although and_
and or_
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
template<typename... Ts>
struct and_;
template<>
struct and_<>: true_type {};
template<typename T, typename... Ts>
struct and_<T, Ts...> : brigand::integral_constant < typename T::value_type, T::value && and_<Ts...>::value > {};
Or
template<typename... Ts>
struct or_;
template<>
struct or_<> : brigand::integral_constant < bool, false > {};
template <typename T, typename... Ts>
struct or_<T, Ts...> : brigand::integral_constant < typename T::value_type, T::value || or_<Ts...>::value > {};
If there's any interest, I can make a pull request. Thanks for the excellent library.
Metadata
Metadata
Assignees
Labels
No labels