Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess][Container] nested containers and scoped allocators
From: Malko (malko.bravi_at_[hidden])
Date: 2015-08-13 17:36:06


I said something wrong when I said that the compiler tries to use the default
constructor. What happens is that it can not match the correct allocator and
hence fails to find a valid constructor.
Let me link the compiler output to clarify what happens when I use
operator[] instead of at(). In bold is the one that should be used but it is
deemed not valid:

    In file included from
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/interprocess/containers/flat_map.hpp:23:
In file included from
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/flat_map.hpp:29:
In file included from
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/detail/flat_tree.hpp:30:
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/vector.hpp:301:9:
error: no matching constructor for initialization of
'boost::interprocess::allocator<int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> >'
      : Allocator(), m_start(), m_size(), m_capacity()
        ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/vector.hpp:725:9:
note: in instantiation of member function
'boost::container::container_detail::vector_alloc_holder<boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> >,
boost::container::container_detail::integral_constant<unsigned int, 2>
>::vector_alloc_holder' requested here
      : m_holder()
        ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/detail/value_init.hpp:35:9:
note: in instantiation of member function 'boost::container::vector<int,
boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > >::vector' requested here
      : m_t()
        ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/flat_map.hpp:1060:52:
note: in instantiation of member function
'boost::container::container_detail::value_init<boost::container::vector&lt;int,
boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > > >::value_init' requested here
         container_detail::value_init<mapped_type> m;
                                                   ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/container/flat_map.hpp:598:82:
note: in instantiation of member function 'boost::container::flat_map<int,
boost::container::vector&lt;int, boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > >, std::less<int>,
boost::interprocess::allocator<std::pair&lt;int,
boost::container::vector&lt;int, boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > > >, boost::interprocess::segment_manager<char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > >::priv_subscript' requested here
   BOOST_MOVE_CONVERSION_AWARE_CATCH( operator[] , key_type, mapped_type&,
this->priv_subscript)
                                                                                
^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/move/detail/move_helpers.hpp:42:14:
note: expanded from macro 'BOOST_MOVE_CONVERSION_AWARE_CATCH'
   { return FWD_FUNCTION(static_cast<const TYPE&>(x)); }\
             ^
include/LVCNext/CacheLayout.hxx:191:9: note: in instantiation of member
function 'boost::container::flat_map<int, boost::container::vector&lt;int,
boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > >, std::less<int>,
boost::interprocess::allocator<std::pair&lt;int,
boost::container::vector&lt;int, boost::interprocess::allocator&lt;int,
boost::interprocess::segment_manager&lt;char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > > >, boost::interprocess::segment_manager<char,
boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0>, 0>,
iset_index> > >::operator[]' requested here
       
sync_policy::edit_data(m_cache_layout)[cache_itr->first][*record_itr] =
type_resize_value;
        ^
/home/user/mbravi/Current/Options/LVCNext/src/cache_layout.cxx:40:6: note:
in instantiation of member function
'lvcnext::CacheLayout<InterProcess::MemoryManager&lt;InterProcess::MemoryMappedFileChar,
Allocator, DynamicResize>, lvcnext::UnsynchronizedData>::Update' requested
here
  cl.Update(cache_add_fields, cache_remove_fields, resize_list);
     ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/interprocess/allocators/allocator.hpp:142:4:
note: candidate constructor template not viable: requires single argument
'other', but no arguments were provided
   allocator(const allocator<T2, SegmentManager> &other)
   ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/interprocess/allocators/allocator.hpp:131:4:
note: *candidate constructor not viable: requires single argument
'segment_mngr', but no arguments were provided
   allocator(segment_manager *segment_mngr)*
   ^
/home/dev/build/third_party/64-rhel5/boost_1_58_0/include/boost/interprocess/allocators/allocator.hpp:136:4:
note: candidate constructor not viable: requires single argument 'other',
but no arguments were provided
   allocator(const allocator &other)
   ^
1 error generated.
make: *** [obj/64d-rhel6/test-rhel6.1.o] Error 1

--
View this message in context: http://boost.2283326.n4.nabble.com/Interprocess-Container-nested-containers-and-scoped-allocators-tp4678830p4678831.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net