any_in.hpp 423 B

123456789101112131415161718
  1. #pragma once
  2. namespace matcher {
  3. template <typename Container>
  4. struct any_in_t {
  5. Container options;
  6. };
  7. template <typename T, typename Container>
  8. bool operator==(T const & t, any_in_t<Container> const & of) {
  9. return std::find(of.options.begin(), of.options.end(), t) != of.options.end();
  10. }
  11. template <typename Container>
  12. any_in_t<Container> any_in(Container && args) {
  13. return {args};
  14. }
  15. }