+2016-05-25 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/c++config (_GLIBCXX14_USE_CONSTEXPR): Remove it.
+ * include/bits/hashtable_policy.h (_Power2_rehash_policy::_M_next_bkt):
+ Remove const qualification on function. Replace
+ _GLIBCXX14_USE_CONSTEXPR on automatic variables with const.
+ (_Power2_rehash_policy::_M_need_rehash): Remove const qualification.
+ (_Power2_rehash_policy::_M_next_bkt): Remove mutable specifier.
+
2016-05-24 François Dumont <fdumont@gcc.gnu.org>
* include/bits/c++config (_GLIBCXX14_USE_CONSTEXPR): New.
#ifndef _GLIBCXX14_CONSTEXPR
# if __cplusplus >= 201402L
# define _GLIBCXX14_CONSTEXPR constexpr
-# define _GLIBCXX14_USE_CONSTEXPR constexpr
# else
# define _GLIBCXX14_CONSTEXPR
-# define _GLIBCXX14_USE_CONSTEXPR const
# endif
#endif
// Return a bucket size no smaller than n (as long as n is not above the
// highest power of 2).
std::size_t
- _M_next_bkt(std::size_t __n) const noexcept
+ _M_next_bkt(std::size_t __n) noexcept
{
- _GLIBCXX14_USE_CONSTEXPR size_t __max_width
- = std::min<size_t>(sizeof(size_t), 8);
- _GLIBCXX14_USE_CONSTEXPR auto __max_bkt
- = std::size_t(1) << (__max_width * __CHAR_BIT__ - 1);
-
+ const auto __max_width = std::min<size_t>(sizeof(size_t), 8);
+ const auto __max_bkt = size_t(1) << (__max_width * __CHAR_BIT__ - 1);
std::size_t __res = __clp2(__n);
if (__res == __n)
// is the new bucket count. If not, return make_pair(false, 0).
std::pair<bool, std::size_t>
_M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
- std::size_t __n_ins) const noexcept
+ std::size_t __n_ins) noexcept
{
if (__n_elt + __n_ins >= _M_next_resize)
{
static const std::size_t _S_growth_factor = 2;
- float _M_max_load_factor;
- mutable std::size_t _M_next_resize;
+ float _M_max_load_factor;
+ std::size_t _M_next_resize;
};
// Base classes for std::_Hashtable. We define these base classes