Created on 2009-08-26.00:00:00 last changed 161 months ago
Proposed resolution:
Change [queue.defn]:
template <class T, class Container = deque<T> > class queue { ... void swap(queue& q) { using std::swap;c.swap(c, q.c); } ... };
Change [priority.queue]:
template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> > class priority_queue { ... void swap(priority_queue& q);{ using std::swap; swap(c, q.c); swap(comp, q.comp); } ... };
Change [stack.defn]:
template <class T, class Container = deque<T> > class stack { ... void swap(stack& s) { using std::swap;c.swap(c, s.c); } ... };
[ Adopted at 2010-11 Batavia ]
[ 2010 Rapperswil: ]
Preference to move the wording into normative text, rather than inline function definitions in the class synopsis. Move to Tenatively Ready.
[ 2010-03-28 Daniel update to diff against N3092. ]
Under [container.adaptors] of N2914 the member function of swap of queue and stack call:
swap(c, q.c);
But under [container.adaptors] of N2723 these members are specified to call:
c.swap(q.c);
Neither draft specifies the semantics of member swap for priority_queue though it is declared.
Although the distinction between member swap and non-member swap is not important when these adaptors are adapting standard containers, it may be important for user-defined containers.
We (Pablo and Howard) feel that it is more likely for a user-defined container to support a namespace scope swap than a member swap, and therefore these adaptors should use the container's namespace scope swap.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-11-24 14:01:03 | admin | set | messages: + msg5419 |
2010-11-14 13:10:57 | admin | set | status: voting -> wp |
2010-11-08 14:14:39 | admin | set | status: ready -> voting |
2010-10-21 19:00:35 | admin | set | messages: + msg4753 |
2010-10-21 19:00:35 | admin | set | status: new -> ready |
2010-10-21 18:28:33 | admin | set | messages: + msg1114 |
2010-10-21 18:28:33 | admin | set | messages: + msg1113 |
2010-10-21 18:28:33 | admin | set | messages: + msg1112 |
2009-08-26 00:00:00 | admin | create |