Questions tagged [boost-container]
10 questions
5
votes
1 answer
Can Boost Container vector manage memory through non raw pointers?
I have a pointer-like struct that goes in the place of a pointer.
The difference with a pointer is that it has extra information that the (also special) allocator can use to deallocate the memory.
This pointer-like structure works well for all…

alfC
- 14,261
- 4
- 67
- 118
4
votes
1 answer
What does boost::container::allocator_traits::is_partially_propagable mean?
I was tring to understand boost::container::allocator_traits when I encountered boost::container::allocator_traits::is_partially_propagable.
I can't find any other document about it online, and I can understand all the other members of…

JiaHao Xu
- 2,452
- 16
- 31
2
votes
1 answer
Shouldn't the iterator types of Boost's small_vector satisfy the std::contiguous_iterator concept?
It is possible to construct a std::span from a std::vector (as the prototype for a contiguous container), both via the range constructor and an explicit pair of iterators:
#include
#include
std::vector owning;
std::span…

lubgr
- 37,368
- 3
- 66
- 117
2
votes
1 answer
boost flat_map batch insertion
I have a C++ program that maintains a boost::flat_map. It receives real-time commands in the form of (key, value). If value is 0, then the flat_map[key] should be deleted if it exists. If value is nonzero, then the flat_map[key] should be set to…

galpo
- 183
- 1
- 7
2
votes
1 answer
gcc compile error "binding ‘const s’ to reference of type ‘s&’ discards qualifiers" when using boost::container::static_vector in other container
When using boost::container::static_vector in another container such as std::vector, gcc is returning a compile error. The following test case reproduces the error:
#include
#include
struct s
{
…

John
- 791
- 1
- 6
- 22
1
vote
1 answer
Boost small_vector empty assign/swap() does not release memory?
As has been discussed previously, to force any standard container to release its heap memory you can just swap with (or assign to) an empty container.
But this does not appear to work for boost::small_vector.
#include…

Nemo
- 70,042
- 10
- 116
- 153
1
vote
1 answer
Boost.Container `dlmalloc` and `jemalloc`
I've introduced Boost.Container into my project which uses jemalloc as default allocator, looks like Boots.Container uses custom allocator which is dlmalloc and of course when linking I'm failing on "multiple definition" linkage error since two…

kreuzerkrieg
- 3,009
- 3
- 28
- 59
1
vote
1 answer
Map insert is ambiguous
I am trying to use boost::container::map. During inserting data, the error "insert is ambiguous" is shown.
#include
#include
#include
int main()
{
boost::container::map map;
…

ram kumar
- 13
- 2
0
votes
1 answer
Why does an argument type of std::set accept {} as argumet but boost::container::flat_set does not?
I converted some methods from argument type const std::set<>& to const boost::container::flat_set<>& with the same template types being passed.
Now I have to change every occurrence of calls to these methods where the argument was {} and have to…

Frank Puck
- 467
- 1
- 11
0
votes
2 answers
Moving between two different contiguous containers
I have a std::vector that I have to move to a boost::container::flat_set.
Both containers are contiguous, so after sorting the vector in principle I could move the data from one to the other.
Is there a way to move the whole data…

alfC
- 14,261
- 4
- 67
- 118