36 lines · plain
1// (C) Copyright Matt Borland 2022.2// Use, modification and distribution are subject to the3// Boost Software License, Version 1.0. (See accompanying file4// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)5 6#ifndef BOOST_MATH_CCMATH_ISUNORDERED_HPP7#define BOOST_MATH_CCMATH_ISUNORDERED_HPP8 9#include <boost/math/ccmath/detail/config.hpp>10 11#ifdef BOOST_MATH_NO_CCMATH12#error "The header <boost/math/isunordered.hpp> can only be used in C++17 and later."13#endif14 15#include <boost/math/ccmath/isnan.hpp>16 17namespace boost::math::ccmath {18 19template <typename T>20inline constexpr bool isunordered(const T x, const T y) noexcept21{22 if(BOOST_MATH_IS_CONSTANT_EVALUATED(x))23 {24 return boost::math::ccmath::isnan(x) || boost::math::ccmath::isnan(y);25 }26 else27 {28 using std::isunordered;29 return isunordered(x, y);30 }31}32 33} // Namespaces34 35#endif // BOOST_MATH_CCMATH_ISUNORDERED_HPP36