Skip to content

Commit fcf98c7

Browse files
mordantememfrob
authored andcommitted
[libc++][NFC] Move concepts to a subheader.
D103357 added some new concepts. Since the header `<concepts>` has moved all its concepts to a separate header these new concepts feel out of place. Move them to the appropriate header. Reviewed By: #libc, Quuxplusone, ldionne Differential Revision: https://reviews.llvm.org/D109075
1 parent 2a9067b commit fcf98c7

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

libcxx/include/__concepts/arithmetic.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
3434
template<class _Tp>
3535
concept floating_point = is_floating_point_v<_Tp>;
3636

37+
// Concept helpers for the internal type traits for the fundamental types.
38+
39+
template <class _Tp>
40+
concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
41+
template <class _Tp>
42+
concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
43+
template <class _Tp>
44+
concept __libcpp_floating_point = __libcpp_is_floating_point<_Tp>::value;
45+
3746
#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
3847

3948
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__format/format_arg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
#ifndef _LIBCPP___FORMAT_FORMAT_ARG_H
1111
#define _LIBCPP___FORMAT_FORMAT_ARG_H
1212

13+
#include <__concepts/arithmetic.h>
1314
#include <__config>
1415
#include <__format/format_error.h>
1516
#include <__format/format_fwd.h>
1617
#include <__functional_base>
1718
#include <__variant/monostate.h>
18-
#include <concepts>
1919
#include <string>
2020
#include <string_view>
2121

libcxx/include/concepts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -152,28 +152,10 @@ namespace std {
152152
#include <__concepts/swappable.h>
153153
#include <__concepts/totally_ordered.h>
154154
#include <__config>
155-
#include <type_traits>
156155
#include <version>
157156

158157
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
159158
#pragma GCC system_header
160159
#endif
161160

162-
_LIBCPP_BEGIN_NAMESPACE_STD
163-
164-
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
165-
166-
// Concept helpers for the internal type traits for the fundamental types.
167-
168-
template <class _Tp>
169-
concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
170-
template <class _Tp>
171-
concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
172-
template <class _Tp>
173-
concept __libcpp_floating_point = __libcpp_is_floating_point<_Tp>::value;
174-
175-
#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
176-
177-
_LIBCPP_END_NAMESPACE_STD
178-
179161
#endif // _LIBCPP_CONCEPTS

libcxx/include/type_traits

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_v
789789

790790
#endif // __has_keyword(__is_integral)
791791

792-
// __libcpp_is_signed_integer, __libcpp_is_unsigned_integer
793-
// <concepts> implements __libcpp_signed_integer, __libcpp_unsigned_integer
794-
795792
// [basic.fundamental] defines five standard signed integer types;
796793
// __int128_t is an extended signed integer type.
797794
// The signed and unsigned integer types, plus bool and the

0 commit comments

Comments
 (0)