28 lines
551 B
C++
28 lines
551 B
C++
export module bedrock.semantics:floating_point;
|
|
|
|
namespace br {
|
|
|
|
template <typename T>
|
|
struct FloatingPointTraits {
|
|
static constexpr bool is_valid = false;
|
|
};
|
|
|
|
template <>
|
|
struct FloatingPointTraits<float> {
|
|
static constexpr bool is_valid = true;
|
|
};
|
|
|
|
template <>
|
|
struct FloatingPointTraits<double> {
|
|
static constexpr bool is_valid = true;
|
|
};
|
|
|
|
template <>
|
|
struct FloatingPointTraits<long double> {
|
|
static constexpr bool is_valid = true;
|
|
};
|
|
|
|
export template <typename T>
|
|
concept FloatingPoint = FloatingPointTraits<T>::is_valid;
|
|
|
|
} // namespace br
|