concepts.h 510 B

123456789101112131415161718
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_COMMON_CONCEPTS_H_
  5. #define CARBON_COMMON_CONCEPTS_H_
  6. #include <concepts>
  7. namespace Carbon {
  8. // True if `T` is the same as one of `OtherT`.
  9. template <typename T, typename... OtherT>
  10. concept SameAsOneOf = (std::same_as<T, OtherT> || ...);
  11. } // namespace Carbon
  12. #endif // CARBON_COMMON_CONCEPTS_H_