976. Class template std::stack should be movable

Section: [stack.defn] Status: Resolved Submitter: Daniel Krügler Opened: 2009-02-01 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all issues with Resolved status.


The synopsis given in [stack.defn] does not show up

requires MoveConstructible<Cont> stack(stack&&);
requires MoveAssignable<Cont> stack& operator=(stack&&);

although the other container adaptors do provide corresponding members.

[ Batavia (2009-05): ]

We agree with the proposed resolution.

Move to Tentatively Ready.

[ 2009-07 Frankfurt ]

Moved from Tentatively Ready to Open only because the wording needs to be tweaked for concepts removal.

[ 2009-08-18 Daniel updates the wording and Howard sets to Review. ]

[ 2009-08-23 Howard adds: ]

1194 also adds these move members using an editorially different style.

[ 2009-10 Santa Cruz: ]

Mark NAD EditorialResolved, addressed by issue 1194.

Proposed resolution:

In the class stack synopsis of [stack.defn] insert:

template <class T, class Container = deque<T> >
class stack {
  explicit stack(const Container&);
  explicit stack(Container&& = Container());
  stack(stack&& s) : c(std::move(s.c)) {}
  stack& operator=(stack&& s) { c = std::move(s.c); return *this; }