我正在尝试在共享内存中创建一个多索引容器,如http://www.boost.org/doc/libs/1_55_0/doc/html/interprocess/allocators_containers.html#interprocess.allocators_containers.containers_explained
在我的例子中,我有几个键IMSI,IMEI,... 我在下一行收到错误
m_pGlobalHash->insert(key);
这是代码
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/indexed_by.hpp>
namespace bmi = boost::multi_index;
namespace bip = boost::interprocess;
typedef uint32_t RU32;
typedef uint64_t RU64;
struct SrValue{
RU32 nVal1;
};
struct UsersKey{
RU64 IMSI;
RU64 IMEI;
SrValue value;
};
struct IMSI_tag{};
struct IMEI_tag{};
typedef bmi::hashed_unique<bmi::tag<IMSI_tag>,
bmi::member<UsersKey, RU64 , &UsersKey::IMSI>,boost::hash<RU64>, std::equal_to<RU64>
> hashed_by_IMSI;
typedef bmi::hashed_unique<bmi::tag<IMEI_tag>,
bmi::member<UsersKey, RU64 , &UsersKey::IMEI>,boost::hash<RU64>, std::equal_to<RU64>
> hashed_by_IMEI;
//index struc definition
struct UsersKey_hash_indices:
bmi::indexed_by<
hashed_by_IMSI,
hashed_by_IMEI>{};
class CrMultiParameterMultiIndex
{
typedef boost::multi_index::multi_index_container<
UsersKey,
UsersKey_hash_indices,
bip::allocator<UsersKey,bip::managed_shared_memory::segment_manager>
> GlobalHash;
boost::interprocess::offset_ptr<GlobalHash> m_pGlobalHash;
public:
void Insert(const UsersKey & key)
{
m_pGlobalHash->insert(key);
}
};
我得到的错误非常长,所以这里只是其中的一部分:
In file included from /hpadir/source/extlibs/boost/boost/interprocess/detail/utilities.hpp:30,
from /hpadir/source/extlibs/boost/boost/interprocess/detail/managed_memory_impl.hpp:22,
from /hpadir/source/extlibs/boost/boost/interprocess/managed_shared_memory.hpp:21,
from implementation/CrMultiParameterMultiIndex.h:29,
from implementation/CrMultiParameterMultiIndex.cpp:1:
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp: In instantiation of ‘const bool boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>::value’:
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp:60: instantiated from ‘boost::interprocess::ipcdetail::enable_if<boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>, void>’
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:703: instantiated from ‘boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>* boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert_(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type, boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>*) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMSI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<1, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMSI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
/hpadir/source/extlibs/boost/boost/multi_index_container.hpp:488: instantiated from ‘std::pair<typename boost::multi_index::detail::multi_index_base_type<Value, IndexSpecifierList, Allocator>::type::node_type*, bool> boost::multi_index::multi_index_container<Value, IndexSpecifierList, Allocator>::insert_(const Value&) [with Value = UsersKey, IndexSpecifierList = UsersKey_hash_indices, Allocator = boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> >]’
/hpadir/source/extlibs/boost/boost/multi_index/detail/index_base.hpp:150: instantiated from ‘std::pair<typename boost::multi_index::detail::multi_index_node_type<Value, IndexSpecifierList, Allocator>::type*, bool> boost::multi_index::detail::index_base<Value, IndexSpecifierList, Allocator>::final_insert_(typename boost::call_traits<Value>::param_type) [with Value = UsersKey, IndexSpecifierList = UsersKey_hash_indices, Allocator = boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> >]’
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:254: instantiated from ‘std::pair<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>, boost::multi_index::detail::bucket_array<typename SuperMeta::type::final_allocator_type> >, bool> boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMSI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<1, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMSI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
implementation/CrMultiParameterMultiIndex.h:131: instantiated from here
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp:74: error: ‘boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >’ is an ambiguous base of ‘boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > > >’
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp: In instantiation of ‘boost::interprocess::ipcdetail::enable_if<boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>, void>’:
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:703: instantiated from ‘boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>* boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert_(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type, boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>*) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMSI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<1, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMSI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
/hpadir/source/extlibs/boost/boost/multi_index_container.hpp:488: instantiated from ‘std::pair<typename boost::multi_index::detail::multi_index_base_type<Value, IndexSpecifierList, Allocator>::type::node_type*, bool> boost::multi_index::multi_index_container<Value, IndexSpecifierList, Allocator>::insert_(const Value&) [with Value = UsersKey, IndexSpecifierList = UsersKey_hash_indices, Allocator = boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> >]’
/hpadir/source/extlibs/boost/boost/multi_index/detail/index_base.hpp:150: instantiated from ‘std::pair<typename boost::multi_index::detail::multi_index_node_type<Value, IndexSpecifierList, Allocator>::type*, bool> boost::multi_index::detail::index_base<Value, IndexSpecifierList, Allocator>::final_insert_(typename boost::call_traits<Value>::param_type) [with Value = UsersKey, IndexSpecifierList = UsersKey_hash_indices, Allocator = boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> >]’
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:254: instantiated from ‘std::pair<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>, boost::multi_index::detail::bucket_array<typename SuperMeta::type::final_allocator_type> >, bool> boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMSI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<1, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMSI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
implementation/CrMultiParameterMultiIndex.h:131: instantiated from here
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp:60: error: ‘boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>::value’ is not a valid template argument for type ‘bool’ because it is a non-constant expression
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp: In instantiation of ‘const bool boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>::value’:
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp:60: instantiated from ‘boost::interprocess::ipcdetail::enable_if<boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>, void>’
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:703: instantiated from ‘boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>* boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert_(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type, boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>*) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMEI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<2, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMEI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:701: instantiated from ‘boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>* boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert_(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type, boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>*) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMSI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<1, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMSI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
/hpadir/source/extlibs/boost/boost/multi_index_container.hpp:488: instantiated from ‘std::pair<typename boost::multi_index::detail::multi_index_base_type<Value, IndexSpecifierList, Allocator>::type::node_type*, bool> boost::multi_index::multi_index_container<Value, IndexSpecifierList, Allocator>::insert_(const Value&) [with Value = UsersKey, IndexSpecifierList = UsersKey_hash_indices, Allocator = boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> >]’
/hpadir/source/extlibs/boost/boost/multi_index/detail/index_base.hpp:150: instantiated from ‘std::pair<typename boost::multi_index::detail::multi_index_node_type<Value, IndexSpecifierList, Allocator>::type*, bool> boost::multi_index::detail::index_base<Value, IndexSpecifierList, Allocator>::final_insert_(typename boost::call_traits<Value>::param_type) [with Value = UsersKey, IndexSpecifierList = UsersKey_hash_indices, Allocator = boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> >]’
/hpadir/source/extlibs/boost/boost/multi_index/hashed_index.hpp:254: instantiated from ‘std::pair<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>, boost::multi_index::detail::bucket_array<typename SuperMeta::type::final_allocator_type> >, bool> boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::insert(typename boost::call_traits<typename boost::multi_index::detail::hashed_index_node<typename SuperMeta::type::node_type>::value_type>::param_type) [with KeyFromValue = boost::multi_index::member<UsersKey, long unsigned int, &UsersKey::IMSI>, Hash = boost::hash<long unsigned int>, Pred = std::equal_to<long unsigned int>, SuperMeta = boost::multi_index::detail::nth_layer<1, UsersKey, UsersKey_hash_indices, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >, TagList = boost::mpl::v_item<IMSI_tag, boost::mpl::vector0<mpl_::na>, 0>, Category = boost::multi_index::detail::hashed_unique_tag]’
implementation/CrMultiParameterMultiIndex.h:131: instantiated from here
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp:74: error: ‘boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >’ is an ambiguous base of ‘boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > >’
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp: In instantiation of ‘boost::interprocess::ipcdetail::enable_if<boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>, void>’:
...
implementation/CrMultiParameterMultiIndex.h:131: instantiated from here
/hpadir/source/extlibs/boost/boost/interprocess/detail/mpl.hpp:60: error: ‘boost::interprocess::ipcdetail::is_convertible<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::index_node_base<UsersKey, boost::interprocess::allocator<UsersKey, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > > > >*, boost::multi_index::detail::hashed_index_node_impl<boost::interprocess::allocator<char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long int, long unsigned int, 0u>, 0ul>, boost::interprocess::iset_index> > >*>::value’ is not a valid template argument for type ‘bool’ because it is a non-constant expression
如果答案是获取特定索引,然后插入。我应该得到哪个指数?为什么?
答案 0 :(得分:4)
这是Boost 1.5版Boost.MultiIndex中的一个错误,已在即将推出的Boost 1.56中得到修复。您可以在
看到更全面的问题描述(以及可以在Boost 1.56发布之前在本地下载和应用的补丁)