Created on 2010-08-25.00:00:00 last changed 170 months ago
Proposed resolution:
See n3140.
[ 2010-10-24 Daniel adds: ]
Accepting n3140 would solve this issue: The move/copy constructor will be defaulted, but the corresponding assignment operators need a non-default implementation because they are supposed to work for references as well.
[ Resolution proposed by ballot comment: ]
Either remove "pair(const pair&) = default;" and "pair& operator=(pair&& p);" from pair's class definition in [pairs.pair] and from [pairs.pair] p.12-13, or give pair explicitly-defaulted copy/move constructors and copy/move assignment operators.
Change tuple to match.
Addresses US-97
pair's class definition in N3092 [pairs.pair] contains "pair(const pair&) = default;" and "pair& operator=(pair&& p);". The latter is described by [pairs.pair] p.12-13.
"pair(const pair&) = default;" is a user-declared explicitly defaulted copy constructor. According to [class.copy]/10, this inhibits the implicitly-declared move constructor. pair should be move constructible. ([class.copy]/7 explains that "pair(pair<U, V>&& p)" will never be instantiated to move pair<T1, T2> to pair<T1, T2>.)tuple(const tuple&) = default; tuple(tuple&&); tuple& operator=(const tuple&); tuple& operator=(tuple&&);
They should all be removed or all be explicitly-defaulted, to be consistent with pair. Additionally, [tuple.cnstr]/8-9 specifies the behavior of an explicitly defaulted function, which is currently inconsistent with pair.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-11-18 14:01:09 | admin | set | status: nad editorial -> resolved |
2010-11-11 03:10:11 | admin | set | status: open -> nad editorial |
2010-10-31 14:01:33 | admin | set | messages: + msg5210 |
2010-10-24 23:23:18 | admin | set | messages: + msg5089 |
2010-10-21 19:47:27 | admin | set | messages: + msg4794 |
2010-08-25 00:00:00 | admin | create |