concepts: move std wrappers into one group
This commit is contained in:
parent
67a3e016e1
commit
6b53abd6b4
28
concepts.hpp
28
concepts.hpp
@ -246,6 +246,26 @@ namespace cruft::concepts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Trivial wrappers around traits
|
||||||
|
namespace cruft::concepts {
|
||||||
|
template <typename T>
|
||||||
|
concept arithmetic = std::is_arithmetic_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept scalar = std::is_scalar_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept enumeration = std::is_enum_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept pointer = std::is_pointer_v<T>;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept reference = std::is_reference_v<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Some handy non-standard concepts
|
// Some handy non-standard concepts
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
@ -268,14 +288,6 @@ namespace cruft::concepts {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
concept arithmetic = std::is_arithmetic_v<T>;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
concept scalar = std::is_scalar_v<T>;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
concept enumeration = std::is_enum_v<T>;
|
|
||||||
|
|
||||||
|
|
||||||
/// A type that supports arithmetic operators.
|
/// A type that supports arithmetic operators.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user