Я пытаюсь сделать многоиндексный контейнер в разделяемой памяти, как в 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
Если ответ получить конкретный индекс, а затем вставить. какой индекс я должен получить и почему?
Это ошибка в Boost 1.55 версии Boost.MultiIndex, которая была исправлена в следующем Boost 1.56. Вы можете увидеть более полное описание проблемы (вместе с патчем, который вы можете скачать и применить локально до выхода Boost 1.56) на
Других решений пока нет …