Advertisement
ulfben

any of, none of

Mar 18th, 2021
987
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template <typename T, typename ...Args>
  2. bool any_of(T const v, Args&&... args) requires (sizeof...(args) > 0)
  3. {
  4.    return ((args == v) || ...);
  5. }
  6.  
  7. template <typename T, typename ...Args>
  8. bool none_of(T const v, Args&&... args) requires (sizeof...(args) > 0)
  9. {
  10.    return ((args != v) && ...);
  11. }
Advertisement
RAW Paste Data Copied
Advertisement