Question

I am trying to make a multi-index container in shared memory like in http://www.boost.org/doc/libs/1_55_0/doc/html/interprocess/allocators_containers.html#interprocess.allocators_containers.containers_explained

In my example i have a few keys IMSI,IMEI,... And i get an error on the following line

m_pGlobalHash->insert(key);

Here is the code

#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);
    }
};

The error i got is very very long, so here is only a part of it:

    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

If the answer is to get a specific index, and then insert. which index should i get and why?

Was it helpful?

Solution

This is a bug in the Boost 1.55 version of Boost.MultiIndex that has been fixed in the upcoming Boost 1.56. You can see a fuller description of the problem (along with a patch you can download and apply locally until Boost 1.56 is out) at

https://svn.boost.org/trac/boost/ticket/9587

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top