concepts: add integral and floating concepts

This commit is contained in:
Danny Robson 2020-02-18 12:17:37 +11:00
parent d45433e97f
commit c001502aa2

View File

@ -21,6 +21,19 @@
///
/// clang#xxx: Remove me when clang includes an implementation of these.
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>
concept default_constructible = std::is_default_constructible_v<T>;