Boost logo

Boost Users :

Subject: [Boost-users] [Container] Does deque allocate memory in default constructor?
From: dariomt_at_[hidden]
Date: 2017-10-25 15:17:00


It seems std::deque implementations are allowed to allocate in the default
constructor [1]

However, boost::container::deque I think does not allocate in the default
constructor, but the docs are not explicit about it.

I can see in the docs:
*Throws*: If allocator_type's default constructor throws.

Which would mean that it cannot throw due to memory exhaustion, so it
cannot allocate memory.

Is my reasoning right?

If yes, would it be possible to make this explicit in the docs?
I think it is relevant, because it might be the deciding factor for
switching from std::deque to boost::container::deque (as it might be my
case).

Thanks!

[1]
https://stackoverflow.com/questions/40203494/why-does-stddeque-allocate-memory-for-its-elements-in-the-default-constructor



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