Created on 1999-11-19.00:00:00 last changed 172 months ago
Rationale:
A key to understanding this issue is that the ultimate use of allocate() is to construct an iterator, and that iterator for zero length sequences must be the container's past-the-end representation. Since this already implies special case code, it would be over-specification to mandate the return value.
Proposed resolution:
Add a note to the allocate row of Table 32: "[Note: If n == 0, the return value is unspecified. --end note]"
Suppose that A is a class that conforms to the Allocator requirements of Table 32, and a is an object of class A What should be the return value of a.allocate(0)? Three reasonable possibilities: forbid the argument 0, return a null pointer, or require that the return value be a unique non-null pointer.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg1833 |
2010-10-21 18:28:33 | admin | set | messages: + msg1832 |
1999-11-19 00:00:00 | admin | create |