Reputation: 1631
When calling this vector constructor:
vector( size_type count,
const T& value,
const Allocator& alloc = Allocator());
If exception will be thrown and some T objects will be already constructed but not all of them, will constructed elements always gets destructor called?
std::vector<std::vector<T>> internalBuffer =
std::vector<std::vector<T>>(1024, std::vector<T>(1024, 0));
I'm assuming default allocator and c++11.
Upvotes: 0
Views: 23
Reputation: 4863
Note: that particular constructor was removed from C++11.
Other than that, you are correct that the destructors of all the already constructed objects will be called in this case.
Upvotes: 1