Skip to content

Commit bcdb456

Browse files
authored
Add C++20 <concepts> (#526)
1 parent f2db504 commit bcdb456

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/libcxx/include/concepts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_CONCEPTS
3+
#define _EZCXX_CONCEPTS
4+
5+
#include <type_traits>
6+
7+
#pragma clang system_header
8+
9+
namespace std {
10+
11+
template <class _Tp, class _Up>
12+
concept same_as = is_same<_Tp, _Up>::value && is_same<_Up, _Tp>::value;
13+
14+
// arithmetic:
15+
16+
template <class _Tp>
17+
concept integral = is_integral_v<_Tp>;
18+
19+
template <class _Tp>
20+
concept signed_integral = integral<_Tp> && is_signed_v<_Tp>;
21+
22+
template <class _Tp>
23+
concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
24+
25+
template <class _Tp>
26+
concept floating_point = is_floating_point_v<_Tp>;
27+
28+
} // namespace std
29+
30+
#endif // _EZCXX_CONCEPTS

0 commit comments

Comments
 (0)