- 7.4k
- 3
- 21
- 55
Though the standard requires the complexity of
std::push_back
andstd::push_front
to be amortised O(1), my implementation has O(n). How
How can I get O(1)?The standard makes strong exception guarantee for
std::insert
,std::emplace
, etc. How
How can I implement that?
Though the standard requires the complexity of
std::push_back
andstd::push_front
to be amortised O(1), my implementation has O(n). How can I get O(1)?The standard makes strong exception guarantee for
std::insert
,std::emplace
, etc. How can I implement that?
Though the standard requires the complexity of
std::push_back
andstd::push_front
to be amortised O(1), my implementation has O(n).
How can I get O(1)?The standard makes strong exception guarantee for
std::insert
,std::emplace
, etc.
How can I implement that?
In the prior obsolete implementation of std::deque prior obsolete implementation of std::deque, I used two std::vectors to contain the elements. But the standard guarantees that pointers and references to elements aren't invalidated when an element at either end is erased or when an element is inserted into either end, which the prior implementation doesn't:
In the prior obsolete implementation of std::deque, I used two std::vectors to contain the elements. But the standard guarantees that pointers and references to elements aren't invalidated when an element at either end is erased or when an element is inserted into either end, which the prior implementation doesn't:
In the prior obsolete implementation of std::deque, I used two std::vectors to contain the elements. But the standard guarantees that pointers and references to elements aren't invalidated when an element at either end is erased or when an element is inserted into either end, which the prior implementation doesn't: