Title
Still swap's with rvalue-references
Status
nad editorial
Section
[library]
Submitter
Daniel Krügler

Created on 2009-10-11.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

  1. Change [pairs]/1 as indicated:

    template <class T1, class T2>
    struct pair {
      ...
      void swap(pair&& p);
    };
    
  2. Change [pairs] before p. 17 as indicated:

    void swap(pair&& p);
    
  3. Change [pairs] before p. 21 as indicated:

    template<class T1, class T2> void swap(pair<T1, T2>& x, pair<T1, T2>& y);
    template<class T1, class T2> void swap(pair<T1, T2>&& x, pair<T1, T2>& y);
    template<class T1, class T2> void swap(pair<T1, T2>& x, pair<T1, T2>&& y);
    
  4. Change [tuple.general]/2, header <tuple> synopsis, as indicated:

    // 20.5.2.9, specialized algorithms:
    template <class... Types>
    void swap(tuple<Types...>& x, tuple<Types...>& y);
    template <class... Types>
    void swap(tuple<Types...>&& x, tuple<Types...>& y);
    template <class... Types>
    void swap(tuple<Types...>& x, tuple<Types...>&& y);
    
  5. Change [tuple.tuple] as indicated:

    // 20.5.2.3, tuple swap
    void swap(tuple&&)
    
  6. Change [tuple.swap] before 1 as indicated:

    void swap(tuple&& rhs);
    
  7. Change [function.objects]/2, header <functional> synopsis, as indicated:

    template<class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&);
    template<class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&&, function<R(ArgTypes...)>&);
    template<class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)&&);
    
  8. Change [func.wrap.func], as indicated:

    // 20.7.15.2.2, function modifiers:
    void swap(function&&);
    template<class F, class A> void assign(F, const A&);
    
    [..]
    
    // 20.7.15.2.7, specialized algorithms:
    template <class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&);
    template <class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&&, function<R(ArgTypes...)>&);
    template <class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&&);
    
  9. Change [func.wrap.func.alg] before 1 as indicated:

    template<class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>& f1, function<R(ArgTypes...)>& f2);
    template<class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>&& f1, function<R(ArgTypes...)>& f2);
    template<class R, class... ArgTypes>
    void swap(function<R(ArgTypes...)>& f1, function<R(ArgTypes...)>&& f2);
    
  10. Change [util.smartptr.shared]/1 as indicated:

    // 20.8.12.2.4, modifiers:
    void swap(shared_ptr&& r);
    
    [..]
    
    // 20.8.12.2.9, shared_ptr specialized algorithms:
    template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b);
    template<class T> void swap(shared_ptr<T>&& a, shared_ptr<T>& b);
    template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>&& b);
    
  11. Change [string.classes]/1, header <string> synopsis, as indicated:

    // 21.4.8.8: swap
    template<class charT, class traits, class Allocator>
    void swap(basic_string<charT,traits,Allocator>& lhs, basic_string<charT,traits,Allocator>& rhs);
    template<class charT, class traits, class Allocator>
    void swap(basic_string<charT,traits,Allocator>&& lhs, basic_string<charT,traits,Allocator>& rhs);
    template<class charT, class traits, class Allocator>
    void swap(basic_string<charT,traits,Allocator>& lhs, basic_string<charT,traits,Allocator>&& rhs);
    
  12. Change [sequences]/1, header <deque> synopsis, as indicated:

    template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(deque<T,Allocator>&& x, deque<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>&& y);
    
  13. Change [sequences]/1, header <list> synopsis, as indicated:

    template <class T, class Allocator>
    void swap(list<T,Allocator>& x, list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(list<T,Allocator>&& x, list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(list<T,Allocator>& x, list<T,Allocator>&& y);
    
  14. Change [sequences]/1, header <queue> synopsis, as indicated:

    template <class T, class Allocator>
    void swap(queue<T, Container>& x, queue<T, Container>& y);
    template <class T, class Container>
    void swap(queue<T, Container>&& x, queue<T, Container>& y);
    template <class T, class Container>
    void swap(queue<T, Container>& x, queue<T, Container>&& y);
    
    template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> >
    class priority_queue;
    template <class T, class Container, class Compare>
    void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>& y);
    template <class T, class Container, class Compare>
    void swap(priority_queue<T, Container, Compare>&& x, priority_queue<T, Container, Compare>& y);
    template <class T, class Container, class Compare>
    void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>&& y);
    
  15. Change [sequences]/1, header <stack> synopsis, as indicated:

    template <class T, class Container>
    void swap(stack<T, Container>& x, stack<T, Container>& y);
    template <class T, class Container>
    void swap(stack<T, Container>&& x, stack<T, Container>& y);
    template <class T, class Container>
    void swap(stack<T, Container>& x, stack<T, Container>&& y);
    
  16. Change [sequences]/1, header <vector> synopsis, as indicated:

    template <class T, class Allocator>
    void swap(vector<T,Allocator>& x, vector<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(vector<T,Allocator>&& x, vector<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(vector<T,Allocator>& x, vector<T,Allocator>&& y);
    
  17. Change [deque]/2 as indicated:

    iterator erase(const_iterator position);
    iterator erase(const_iterator first, const_iterator last);
    void swap(deque<T,Allocator>&&);
    void clear();
    
    [..]
    
    // specialized algorithms:
    template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(deque<T,Allocator>&& x, deque<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>&& y);
    
  18. Change [deque.special] as indicated:

    template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(deque<T,Allocator>&& x, deque<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>&& y);
    
  19. Change [forwardlist]/2 as indicated:

    iterator erase_after(const_iterator position);
    iterator erase_after(const_iterator position, iterator last);
    void swap(forward_list<T,Allocator>&&);
    
    [..]
    
    // 23.3.3.6 specialized algorithms:
    template <class T, class Allocator>
    void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(forward_list<T,Allocator>&& x, forward_list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>&& y);
    
  20. Change [forwardlist.spec] as indicated:

    template <class T, class Allocator>
    void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(forward_list<T,Allocator>&& x, forward_list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>&& y);
    
  21. Change [list]/2 as indicated:

    iterator erase(const_iterator position);
    iterator erase(const_iterator position, const_iterator last);
    void swap(list<T,Allocator>&&);
    void clear();
    
    [..]
    
    // specialized algorithms:
    template <class T, class Allocator>
    void swap(list<T,Allocator>& x, list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(list<T,Allocator>&& x, list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(list<T,Allocator>& x, list<T,Allocator>&& y);
    
  22. Change [list.special] as indicated:

    template <class T, class Allocator>
    void swap(list<T,Allocator>& x, list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(list<T,Allocator>&& x, list<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(list<T,Allocator>& x, list<T,Allocator>&& y);
    
  23. Change [queue.defn] as indicated:

    void swap(queue&& q) { c.swap(q.c); }
    
    [..]
    
    template <class T, class Container>
    void swap(queue<T, Container>& x, queue<T, Container>& y);
    template <class T, class Container>
    void swap(queue<T, Container>&& x, queue<T, Container>& y);
    template <class T, class Container>
    void swap(queue<T, Container>& x, queue<T, Container>&& y);
    
  24. Change [queue.special] as indicated:

    template <class T, class Container>
    void swap(queue<T, Container>& x, queue<T, Container>& y);
    template <class T, class Container>
    void swap(queue<T, Container>&& x, queue<T, Container>& y);
    template <class T, class Container>
    void swap(queue<T, Container>& x, queue<T, Container>&& y);
    
  25. Change [priority.queue]/1 as indicated:

    void swap(priority_queue&&);
    
    // no equality is provided
    template <class T, class Container, class Compare>
    void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>& y);
    template <class T, class Container, class Compare>
    void swap(priority_queue<T, Container, Compare>&& x, priority_queue<T, Container, Compare>& y);
    template <class T, class Container, class Compare>
    void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>&& y);
    
  26. Change [priqueue.special] as indicated:

    template <class T, class Container, Compare>
    void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>& y);
    template <class T, class Container, Compare>
    void swap(priority_queue<T, Container, Compare>&& x, priority_queue<T, Container, Compare>& y);
    template <class T, class Container, Compare>
    void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>&& y);
    
  27. Change [stack.defn] as indicated:

    void swap(stack&& s) { c.swap(s.c); }
    
    [..]
    
    template <class T, class Allocator>
    void swap(stack<T,Allocator>& x, stack<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(stack<T,Allocator>&& x, stack<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(stack<T,Allocator>& x, stack<T,Allocator>&& y);
    
  28. Change [stack.special] as indicated:

    template <class T, class Container>
    void swap(stack<T, Container>& x, stack<T, Container>& y);
    template <class T, class Container>
    void swap(stack<T, Container>&& x, stack<T, Container>& y);
    template <class T, class Container>
    void swap(stack<T, Container>& x, stack<T, Container>&& y);
    
  29. Change [vector]/2 as indicated:

    void swap(vector<T,Allocator>&&);
    void clear();
    
    [..]
    
    // specialized algorithms:
    template <class T, class Allocator>
    void swap(vector<T,Allocator>& x, vector<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(vector<T,Allocator>&& x, vector<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(vector<T,Allocator>& x, vector<T,Allocator>&& y);
    
  30. Change [vector.capacity] before p. 8 as indicated:

    void swap(vector<T,Allocator>&& x);
    
  31. Change [vector.special] as indicated:

    template <class T, class Allocator>
    void swap(vector<T,Allocator>& x, vector<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(vector<T,Allocator>&& x, vector<T,Allocator>& y);
    template <class T, class Allocator>
    void swap(vector<T,Allocator>& x, vector<T,Allocator>&& y);
    
  32. Change [vector.bool]/1 as indicated:

    iterator erase(const_iterator first, const_iterator last);
    void swap(vector<bool,Allocator>&&);
    static void swap(reference x, reference y);
    
  33. Change [associative]/1, header <map> synopsis as indicated:

    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator&& x, map<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator& x, map<Key,T,Compare,Allocator>&& y);
    
    [..]
    
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator&& x, multimap<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator& x, multimap<Key,T,Compare,Allocator>&& y);
    
  34. Change [associative]/1, header <set> synopsis as indicated:

    template <class Key, class Compare, class Allocator>
    void swap(set<Key,Compare,Allocator>& x, set<Key,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(set<Key,T,Compare,Allocator&& x, set<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(set<Key,T,Compare,Allocator& x, set<Key,T,Compare,Allocator>&& y);
    
    [..]
    
    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multiset<Key,T,Compare,Allocator&& x, multiset<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multiset<Key,T,Compare,Allocator& x, multiset<Key,T,Compare,Allocator>&& y);
    
  35. Change [map]/2 as indicated:

    iterator erase(const_iterator first, const_iterator last);
    void swap(map<Key,T,Compare,Allocator>&&);
    void clear();
    
    [..]
    
    // specialized algorithms:
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator&& x, map<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator& x, map<Key,T,Compare,Allocator>&& y);
    
  36. Change [map.special] as indicated:

    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator>&& x, map<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>&& y);
    
  37. Change [multimap]/2 as indicated:

    iterator erase(const_iterator first, const_iterator last);
    void swap(multimap<Key,T,Compare,Allocator>&&);
    void clear();
    
    [..]
    
    // specialized algorithms:
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator&& x, multimap<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator& x, multimap<Key,T,Compare,Allocator>&& y);
    
  38. Change [multimap.special] as indicated:

    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator>&& x, multimap<Key,T,Compare,Allocator>& y);
    template <class Key, class T, class Compare, class Allocator>
    void swap(multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>&& y);
    
  39. Change [set]/2 and [set.special] as indicated: (twice!)

    // specialized algorithms:
    template <class Key, class Compare, class Allocator>
    void swap(set<Key,Compare,Allocator>& x, set<Key,Compare,Allocator>& y);
    template <class Key, class Compare, class Allocator>
    void swap(set<Key,Compare,Allocator&& x, set<Key,Compare,Allocator>& y);
    template <class Key, class Compare, class Allocator>
    void swap(set<Key,Compare,Allocator& x, set<Key,Compare,Allocator>&& y);
    
  40. Change [multiset]/2 as indicated:

    iterator erase(const_iterator first, const_iterator last);
    void swap(multiset<Key,Compare,Allocator>&&);
    void clear();
    
    [..]
    
    // specialized algorithms:
    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y);
    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator&& x, multiset<Key,Compare,Allocator>& y);
    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator& x, multiset<Key,Compare,Allocator>&& y);
    
  41. Change [multiset.special] as indicated:

    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y);
    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator>&& x, multiset<Key,Compare,Allocator>& y);
    template <class Key, class Compare, class Allocator>
    void swap(multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>&& y);
    
Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

Editor accepts as NAD Editorial.

Date: 2009-10-11.00:00:00

The current library contains still rvalue reference-swaps that seem to be overlooked in the process of switching back to lvalue-ref swaps.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1252
2010-10-21 18:28:33adminsetmessages: + msg1251
2009-10-11 00:00:00admincreate