id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 6771,unordered_map comparing float in assertion statement causes large warning in gcc,Ryan Fogarty ,Daniel James,"In unordered/detail/table.hpp an assertion statement in function std::size_t min_buckets_for_size(std::size_t size) const compares a floating point which causes deeply nested warning statements in gcc with some compiler flags (possibly -Wall/-Wfloat-equal/-pedantic) {{{ BOOST_ASSERT(this->mlf_ != 0); }}} Because of the nature of the template code the warning is very difficult to read and it is not obvious whether it is a problem in user's code or the library (from a quick glance). A simple alternative eliminates the issue: {{{ BOOST_ASSERT(this->mlf_ > 0.0f || this->mlf_ < 0.0); }}} Bug has existed for quite a while. It is at least as old as 1.46, and I've confirmed that exists in 1.47 (line:138) - 1.49 (line:387) and is also on the trunk. As an example The warning in gcc 4.7.0 ends with: /usr/local/boost_1_49_0/include/boost/unordered/detail/table.hpp:387:13: warning: comparing floating point with == or != is unsafe [-Wfloat-equal] ",Bugs,closed,Boost 1.50.0,unordered,Boost Release Branch,Problem,fixed,,