concepts: add integral and floating concepts
This commit is contained in:
parent
d45433e97f
commit
c001502aa2
13
concepts.hpp
13
concepts.hpp
@ -21,6 +21,19 @@
|
|||||||
///
|
///
|
||||||
/// clang#xxx: Remove me when clang includes an implementation of these.
|
/// clang#xxx: Remove me when clang includes an implementation of these.
|
||||||
namespace cruft::concepts {
|
namespace cruft::concepts {
|
||||||
|
template <typename T>
|
||||||
|
concept floating_point = std::is_floating_point_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept integral = std::is_integral_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept signed_integral = integral<T> && std::is_signed_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept unsigned_integral = integral<T> && std::is_unsigned_v<T>;
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
concept default_constructible = std::is_default_constructible_v<T>;
|
concept default_constructible = std::is_default_constructible_v<T>;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user