Created on 2007-11-11.00:00:00 last changed 118 months ago
Proposed resolution:
Add after [container.requirements]/12:
-12- Objects passed to member functions of a container as rvalue references shall not be elements of that container. No diagnostic required.
-13- Objects bound to the function parameter pack of the emplace member function shall not be elements or sub-objects of elements of the container. No diagnostic required.
[ 2009-07 Frankfurt ]
The problem is broader than emplace. The LWG doesn't feel that it knows how to write wording that prohibits all of the problematic use cases at this time.
NAD Future.
[ Bellevue: ]
The proposed addition (13) is partially redundant with the existing paragraph 12. Why was the qualifier "rvalues" added to paragraph 12? Why does it not cover subelements and pointers?
Resolution: Alan Talbot to rework language, then set state to Review.
In an emplace member function the function parameter pack may be bound to a priori unlimited number of objects: some or all of them can be elements of the container itself. Apparently, in order to conform to the blanket statement [container.requirements]/11, the implementation must check all of them for that possibility. A possible solution can involve extending the exception in [container.requirements]/12 also to the emplace member. As a side note, the push_back and push_front member functions are luckily not affected by this problem, can be efficiently implemented anyway.
History | |||
---|---|---|---|
Date | User | Action | Args |
2015-03-29 13:35:18 | admin | set | messages: + msg7260 |
2015-03-29 13:35:18 | admin | set | status: open -> nad |
2014-11-24 15:11:58 | admin | set | status: nad future -> open |
2010-10-21 18:28:33 | admin | set | messages: + msg3682 |
2010-10-21 18:28:33 | admin | set | messages: + msg3681 |
2010-10-21 18:28:33 | admin | set | messages: + msg3680 |
2010-10-21 18:28:33 | admin | set | messages: + msg3679 |
2007-11-11 00:00:00 | admin | create |