Title
domain of allocator::address
Status
resolved
Section
[allocator.requirements]
Submitter
Howard Hinnant

Created on 2007-02-08.00:00:00 last changed 163 months ago

Messages

Date: 2010-10-21.18:28:33

[ 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. ]

Date: 2010-10-21.18:28:33

[ post Oxford: This would be rendered NAD Editorial by acceptance of N2257. ]

Date: 2010-10-21.18:28:33

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.

Date: 2010-11-20.00:05:46

[ 2009-10 Santa Cruz: ]

NAD EditorialResolved. Addressed by N2982.

Date: 2009-07-28.00:00:00

[ 2009-07-28 Reopened by Alisdair. No longer solved by concepts. ]

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

Fixed by N2768.

Date: 2009-04-28.00:00:00

[ 2009-04-28 Pablo adds: ]

Tentatively-ready NAD Editorial as fixed by N2768.

Date: 2010-10-21.18:28:33

[ post San Francisco: ]

Pablo recommends NAD Editorial, solved by N2768.

Date: 2007-02-08.00:00:00

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:45adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg3297
2010-10-21 18:28:33adminsetmessages: + msg3296
2010-10-21 18:28:33adminsetmessages: + msg3295
2010-10-21 18:28:33adminsetmessages: + msg3294
2010-10-21 18:28:33adminsetmessages: + msg3293
2010-10-21 18:28:33adminsetmessages: + msg3292
2010-10-21 18:28:33adminsetmessages: + msg3291
2010-10-21 18:28:33adminsetmessages: + msg3290
2007-02-08 00:00:00admincreate