template<class T>
struct Numeric {
- // if your program traps here, you need to create a
- // std::numeric_limits class for your type T. see
- // see C++ standard 18.3.2.2
- static_assert(
- std::numeric_limits<T>::is_specialized,
- "std::numeric_limits<T> has not been specialized for this type"
- );
+ constexpr static bool value = std::numeric_limits<T>::is_specialized;
+ constexpr operator bool (){
+ return value;
+ }
};
} // safe_numerics