1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LIBCXX_TEST_CONCEPTS_LANG_CONCEPTS_ARITHMETIC_H_
10#define LIBCXX_TEST_CONCEPTS_LANG_CONCEPTS_ARITHMETIC_H_
11
12#include <concepts>
13
14// This overload should never be called. It exists solely to force subsumption.
15template <std::integral I>
16constexpr bool CheckSubsumption(I) {
17 return false;
18}
19
20// clang-format off
21template <std::integral I>
22requires std::signed_integral<I> && (!std::unsigned_integral<I>)
23constexpr bool CheckSubsumption(I) {
24 return std::is_signed_v<I>;
25}
26
27template <std::integral I>
28requires std::unsigned_integral<I> && (!std::signed_integral<I>)
29constexpr bool CheckSubsumption(I) {
30 return std::is_unsigned_v<I>;
31}
32// clang-format on
33
34enum ClassicEnum { a, b, c };
35enum class ScopedEnum { x, y, z };
36struct EmptyStruct {};
37
38#endif // LIBCXX_TEST_CONCEPTS_LANG_CONCEPTS_ARITHMETIC_H_
39

source code of libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/arithmetic.h