#ifndef RFL_ALLOF_HPP_ #define RFL_ALLOF_HPP_ #include "rfl/Result.hpp" namespace rfl { /// Requires that all of the contraints C and Cs be true. template struct AllOf { template static rfl::Result validate(T _value) noexcept { return validate_impl(_value); } private: template static rfl::Result validate_impl(T _value) noexcept { if constexpr (sizeof...(Tail) == 0) { return Head::validate(_value); } else { return Head::validate(_value).and_then(validate_impl); } } }; } // namespace rfl #endif