考虑一下这个成功编译的代码:
#include <boost/intrusive/unordered_set.hpp>
using namespace boost::intrusive;
typedef unordered_set_member_hook<> Hook;
struct Item
{
Hook hook;
};
typedef unordered_set<Item,
member_hook<Item, Hook, &Item::hook>,
size_type<uint32_t> > Map;
static_assert(4 == sizeof(typename Map::size_type));
static_assert(8 == sizeof(decltype(Map::suggested_upper_bucket_count(1000))));
在the documentation和the code中,suggested_upper_bucket_count()
以这种方式声明:
static size_type suggested_upper_bucket_count(size_type);
那么Map::size_type
是4个字节(uint32_t
)又怎么可能suggested_upper_bucket_count()
的结果是8个字节呢?
答案 0 :(得分:1)
这是在Boost 1.65
中修复的错误