This should work, I think
template<typename T>
class MyClass {
// ...
static constexpr T minT = std::numeric_limits<T>::has_infinity
? -std::numeric_limits<T>::infinity()
: std::numeric_limits<T>::lowest();
static constexpr T maxT = std::numeric_limits<T>::has_infinity
? std::numeric_limits<T>::infinity()
: std::numeric_limits<T>::max();
}
but I was wondering whether I am missing a simpler way.
Aucun commentaire:
Enregistrer un commentaire