| 27 | |
| 28 | template <class... Ts> |
| 29 | class any_of { |
| 30 | public: |
| 31 | constexpr explicit any_of(Ts... ts) : ts_{ts...} {} |
| 32 | |
| 33 | constexpr auto operator==(std::common_type_t<Ts...> t) const { |
| 34 | return std::apply([t](auto... args) { return eq(t, args...); }, ts_); |
| 35 | } |
| 36 | |
| 37 | private: |
| 38 | template <class T, class U, class... TArgs> |
| 39 | static constexpr auto eq(const T& t, const U& u, const TArgs&... args) { |
| 40 | using namespace boost::ut; |
| 41 | if constexpr (sizeof...(args) > 0) { |
| 42 | return (that % detail::value{u} == t) or eq(t, args...); |
| 43 | } else { |
| 44 | return (that % detail::value{u} == t); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | std::tuple<Ts...> ts_; |
| 49 | }; |
| 50 | |
| 51 | int main() { |
| 52 | using namespace boost::ut; |
nothing calls this directly
no outgoing calls
no test coverage detected