Boost.MultiIndex模板替换失败
Boost.MultiIndex template substitution failure?
我正在尝试使用boost::multi_index_container,它似乎在某个地方被模板元编程的魔力所窒息。我得到了一个巨大的错误转储,以结尾
/opt/local/include/boost/multi_index/hashed_index.hpp:743:9:错误:'类boost::multi_index::detail::hashed_index,boost::hash,std::equal_to,boost::multi_index::detail::nth_layer<1.boost::intrusive_ptr,boost::multi_index::indexed_by>,boost::multi_index::ordered_non_unique,&md::Order::px>>,std::分配器>>,boost::mpl::vector0,boost::multi_index::detail::hashed_unique_tag>'没有名为的成员'final_delete_node_'这个->final_delete_node_(
我在Mac OS X.8 Mountain Lion上使用Boost 1.53(Mac端口)。如何编译以下代码?谢谢
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include "Product.hpp"
#include <iostream>
int main(int argc, char* argv[])
{
boost::multi_index_container<
boost::intrusive_ptr<Product>,
boost::multi_index::indexed_by<
boost::multi_index::hashed_unique<
boost::multi_index::const_mem_fun<
Product,
id_t,
static_cast<id_t (Product::*)() const>(&Product::id)
>
>,
boost::multi_index::ordered_non_unique<
boost::multi_index::const_mem_fun<
Product,
price_t,
static_cast<price_t (Product::*)() const>(&Product::price)
>
>
>
> cont;
auto o = boost::intrusive_ptr<Product>(new Product());
o->id(1).price(price_t(14.75));
cont.insert(o);
auto it = cont.get<1>().find(price_t(14.75));
if (it!=cont.get<1>().end())
std::cout << *(it);
return 0;
}
未能包含<boost/multi_index/ordered_índex.hpp>
?
相关文章:
- 模板参数替换失败,并且未完成隐式转换
- 要求子句中不允许哪些替换失败?
- 模板参数推导/替换失败,lambda作为函数指针
- 类模板参数推导失败会导致替换失败
- C++ 带有 decltype 的 SFINAE:替换失败成为错误?
- 折叠表达式模板参数推导/替换失败
- 使用"std::function"和先前推断的模板参数替换失败 - 为什么?
- 模板参数推导/替换失败 C++
- 当Boost ::绑定模板函数时,模板参数扣除/替换失败
- SFINAE使用演绎,但用替换失败
- 为什么代码中的模板参数推导/替换失败?-.
- GCC 模板参数推断/替换失败
- 为什么模板参数推导/替换失败
- 模板模板参数的替换失败
- C++模板参数推导/替换失败
- C++模板参数推导/替换失败:
- 使用类型名参数时,模板参数推导/替换失败
- 有没有办法将模板的替换失败转换为布尔值(真/假)或标签(标准::true_type/标准::false_type)
- 模板参数扣除/替换失败-STD :: find()
- std::tuple_cat替换失败