any_of.h 437 B

1234567891011121314151617181920212223
  1. //
  2. // any_of.h
  3. // string-utils
  4. //
  5. // Created by Sam Jaffe on 2/13/21.
  6. // Copyright © 2021 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. #include <string>
  10. namespace string_utils {
  11. bool any_of(std::string const &) { return false; }
  12. template <typename T, typename... Ts>
  13. bool any_of(std::string const &value, T && in, Ts &&...rest) {
  14. return value == std::forward<T>(in) ||
  15. any_of(value, std::forward<Ts>(rest)...);
  16. }
  17. }