Skip to content

Commit 3e0f49e

Browse files
committed
[libc++] Move __core_convertible_to into __type_traits/is_core_convertible.h
Signed-off-by: yronglin <[email protected]>
1 parent 7754d35 commit 3e0f49e

File tree

5 files changed

+9
-34
lines changed

5 files changed

+9
-34
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ set(files
307307
__concepts/constructible.h
308308
__concepts/convertible_to.h
309309
__concepts/copyable.h
310-
__concepts/core_convertible_to.h
311310
__concepts/derived_from.h
312311
__concepts/destructible.h
313312
__concepts/different_from.h

libcxx/include/__concepts/core_convertible_to.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

libcxx/include/__expected/expected.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define _LIBCPP___EXPECTED_EXPECTED_H
1111

1212
#include <__assert>
13-
#include <__concepts/core_convertible_to.h>
1413
#include <__config>
1514
#include <__expected/bad_expected_access.h>
1615
#include <__expected/unexpect.h>
@@ -26,6 +25,7 @@
2625
#include <__type_traits/is_assignable.h>
2726
#include <__type_traits/is_constructible.h>
2827
#include <__type_traits/is_convertible.h>
28+
#include <__type_traits/is_core_convertible.h>
2929
#include <__type_traits/is_function.h>
3030
#include <__type_traits/is_nothrow_assignable.h>
3131
#include <__type_traits/is_nothrow_constructible.h>

libcxx/include/__type_traits/is_core_convertible.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ template <class _Tp, class _Up>
3030
struct __is_core_convertible<_Tp, _Up, decltype(static_cast<void (*)(_Up)>(0)(static_cast<_Tp (*)()>(0)()))>
3131
: true_type {};
3232

33+
34+
#if _LIBCPP_STD_VER >= 20
35+
36+
template <class _Tp, class _Up>
37+
concept __core_convertible_to = __is_core_convertible_v<_Tp, _Up>;
38+
39+
#endif // _LIBCPP_STD_VER >= 20
40+
3341
_LIBCPP_END_NAMESPACE_STD
3442

3543
#endif // _LIBCPP___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H

libcxx/include/module.modulemap.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,6 @@ module std [system] {
10751075
module constructible { header "__concepts/constructible.h" }
10761076
module convertible_to { header "__concepts/convertible_to.h" }
10771077
module copyable { header "__concepts/copyable.h" }
1078-
module core_convertible_to { header "__concepts/core_convertible_to.h" }
10791078
module derived_from { header "__concepts/derived_from.h" }
10801079
module destructible { header "__concepts/destructible.h" }
10811080
module different_from { header "__concepts/different_from.h" }

0 commit comments

Comments
 (0)