Closed 635716742 closed 3 months ago
Instead of std::vector
you have to use boost::interprocess::vector
, please see https://www.boost.org/doc/libs/1_83_0/doc/html/interprocess/allocators_containers.html#interprocess.allocators_containers.containers_explained. This is because of incompatibilities such as the one you encountered. More about these and further issues with the STL containers are in the docs linked.
This issue should be closed now.
I would like to use boost.interprocess in a way similar to the
"code"
below, but encountered acompile error
. Upon analysis, it seems that the problem arises from the STL having two partial specializations for the templateindirectly_readable_traits
, which require the parameter to either containvalue_type
orelement_type
. However, inboost::interprocess::offset_ptr
, bothvalue_type
andelement_type
are present simultaneously, leading to template ambiguity during instantiation. I am hoping for a solution or guidance on how to correctly use boost.interprocess in conjunction with the STL.code
compile error
STL and boost sound code
My ENV:
ubuntu20.04 gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0 boost version 1.71( I also used 1.83) c++version: c++2a