Created on 2007-02-08.00:00:00 last changed 170 months ago
[ Kona (2007): This issue is section 8 of N2387. There was some discussion of it but no resolution to this issue was recorded. Moved to Open. ]
[ post Oxford: This would be rendered NAD Editorial by acceptance of N2257. ]
Proposed resolution:
Change [allocator.requirements]:
r : a value of type X::reference
obtained by the expression *p.s : a value of type X::const_reference
obtained by the expression *q or by conversion from a value r.
[ 2009-10 Santa Cruz: ]
NAD EditorialResolved. Addressed by N2982.
[ 2009-07-28 Reopened by Alisdair. No longer solved by concepts. ]
[ 2009-07 Frankfurt ]
Fixed by N2768.
[ 2009-04-28 Pablo adds: ]
Tentatively-ready NAD Editorial as fixed by N2768.
[ post San Francisco: ]
Pablo recommends NAD Editorial, solved by N2768.
The table of allocator requirements in [allocator.requirements] describes allocator::address as:
a.address(r) a.address(s)
where r and s are described as:
a value of type X::reference obtained by the expression *p.
and p is
a value of type X::pointer, obtained by calling a1.allocate, where a1 == a
This all implies that to get the address of some value of type T that value must have been allocated by this allocator or a copy of it.
However sometimes container code needs to compare the address of an external value of type T with an internal value. For example list::remove(const T& t) may want to compare the address of the external value t with that of a value stored within the list. Similarly vector or deque insert may want to make similar comparisons (to check for self-referencing calls).
Mandating that allocator::address can only be called for values which the allocator allocated seems overly restrictive.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-11-19 19:04:45 | admin | set | status: nad editorial -> resolved |
2010-10-21 18:28:33 | admin | set | messages: + msg3297 |
2010-10-21 18:28:33 | admin | set | messages: + msg3296 |
2010-10-21 18:28:33 | admin | set | messages: + msg3295 |
2010-10-21 18:28:33 | admin | set | messages: + msg3294 |
2010-10-21 18:28:33 | admin | set | messages: + msg3293 |
2010-10-21 18:28:33 | admin | set | messages: + msg3292 |
2010-10-21 18:28:33 | admin | set | messages: + msg3291 |
2010-10-21 18:28:33 | admin | set | messages: + msg3290 |
2007-02-08 00:00:00 | admin | create |