Questions tagged [uses-allocator]

3 questions
4
votes
1 answer

What is "uses allocator" and "scoped allocator" construction in c++

There are quite a few questions on here which talk about uses allocator and scoped allocator but they come from an assumption of knowing what these are and what they are for. The explanation in the usual C++ references explains the what but not so…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
3
votes
0 answers

Tuple with pair and uses-allocator construction

std::tuple support uses-allocator construction, while pairs are a kind of corner case with a special treatment that makes them work as-if they supported uses-allocator construction. However, imagine to combine them in a container…
skypjack
  • 49,335
  • 19
  • 95
  • 187
0
votes
1 answer

Allocator object type conversion

Is there a way, having one allocator object for type T, to use the SAME object to allocate memory for any other type. Maybe some magic with static_cast or rebind can help? Because right now I only have an idea of how to use rebind to derive the…