Skip to main content
Code Review

Return to Question

tagged deque. Remove queue? Add reinventing-the-wheel when author wasn't aware when asking?
Source Link
greybeard
  • 7.4k
  • 3
  • 21
  • 55
  1. Though the standard requires the complexity of std::push_back and std::push_front to be amortised O(1), my implementation has O(n). How
    How can I get O(1)?

  2. The standard makes strong exception guarantee for std::insert, std::emplace, etc. How
    How can I implement that?

  1. Though the standard requires the complexity of std::push_back and std::push_front to be amortised O(1), my implementation has O(n). How can I get O(1)?

  2. The standard makes strong exception guarantee for std::insert, std::emplace, etc. How can I implement that?

  1. Though the standard requires the complexity of std::push_back and std::push_front to be amortised O(1), my implementation has O(n).
    How can I get O(1)?

  2. The standard makes strong exception guarantee for std::insert, std::emplace, etc.
    How can I implement that?

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

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:

Notice removed Draw attention by Dannyu NDos
Bounty Ended with Incomputable's answer chosen by Dannyu NDos
Tweeted twitter.com/StackCodeReview/status/804006535059873792
edited tags
Link
200_success
  • 145.6k
  • 22
  • 190
  • 479
Notice added Draw attention by Dannyu NDos
Bounty Started worth 50 reputation by Dannyu NDos
Fixed std::deque::resize, added comments.
Source Link
Dannyu NDos
  • 377
  • 4
  • 15
Loading
Clean-up.
Source Link
Dannyu NDos
  • 377
  • 4
  • 15
Loading
deleted 1 character in body
Source Link
Dannyu NDos
  • 377
  • 4
  • 15
Loading
added 64 characters in body
Source Link
BCdotWEB
  • 11.4k
  • 2
  • 28
  • 45
Loading
added 125 characters in body
Source Link
Dannyu NDos
  • 377
  • 4
  • 15
Loading
Source Link
Dannyu NDos
  • 377
  • 4
  • 15
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /