| 1234567891011121314151617181920 |
- #pragma once
- #include <array>
- namespace matcher {
- template <typename T, size_t I>
- struct any_of_t {
- std::array<T, I> options;
- };
-
- template <typename T, size_t I>
- bool operator==(T const & t, any_of_t<T, I> const & of) {
- return std::find(of.options.begin(), of.options.end(), t) != of.options.end();
- }
-
- template <typename... Args>
- any_of_t<typename std::common_type<Args...>::type, sizeof...(Args)> any_of(Args &&... args) {
- return {{args...}};
- }
- }
|