maths: remove util::is_nan in preference of std::isnan

This commit is contained in:
Danny Robson 2018-05-10 12:45:20 +10:00
parent 4116442e40
commit 2ec9a7ebe6
2 changed files with 1 additions and 25 deletions

View File

@ -113,7 +113,7 @@ namespace util::cast {
auto dst = static_cast<DstT> (src); auto dst = static_cast<DstT> (src);
if constexpr (std::is_floating_point_v<SrcT>) { if constexpr (std::is_floating_point_v<SrcT>) {
if (util::is_nan (src)) { if (std::isnan (src)) {
// NaNs must remaing as NaN's. They're important. // NaNs must remaing as NaN's. They're important.
CHECK (std::is_floating_point_v<DstT>); CHECK (std::is_floating_point_v<DstT>);
CHECK (std::isnan (dst)); CHECK (std::isnan (dst));

View File

@ -188,30 +188,6 @@ namespace util {
} }
//-------------------------------------------------------------------------
template <typename T>
constexpr
typename std::enable_if_t<
std::is_floating_point<T>::value, bool
>
is_nan (T t)
{
return std::isnan (t);
}
//-------------------------------------------------------------------------
template <typename T>
constexpr
typename std::enable_if_t<
!std::is_floating_point<T>::value, bool
>
is_nan (const T&)
{
return false;
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// exponentials // exponentials