mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 14:04:27 +02:00
Check errno after calling frexp - this is pretty slow and unecessary on most platforms, but this close to release it seems better to be over cautious.
[SVN r29255]
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <errno.h>
|
||||||
#include <boost/limits.hpp>
|
#include <boost/limits.hpp>
|
||||||
#include <boost/functional/detail/float_functions.hpp>
|
#include <boost/functional/detail/float_functions.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
@@ -264,7 +265,9 @@ namespace boost
|
|||||||
inline std::size_t float_hash_value(T v)
|
inline std::size_t float_hash_value(T v)
|
||||||
{
|
{
|
||||||
int exp = 0;
|
int exp = 0;
|
||||||
|
errno = 0;
|
||||||
v = boost::hash_detail::call_frexp(v, &exp);
|
v = boost::hash_detail::call_frexp(v, &exp);
|
||||||
|
if(errno) return 0;
|
||||||
|
|
||||||
std::size_t seed = 0;
|
std::size_t seed = 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user