Created on 2018-03-16.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4727.
Edit [ios.base.storage] as indicated:
long& iword(int idx);-?- Requires: idx is a value obtained by a call to xalloc.
-3- Effects: If iarray is a null pointer, […] […]void*& pword(int idx);-?- Requires: idx is a value obtained by a call to xalloc.
-5- Effects: If iarray is a null pointer, […] […]
[ 2018-06 Rapperswil: Adopted ]
[ 2018-03-27 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]
Is calling iword and pword with a negative argument undefined, or should it cause a failure condition (and return a valid reference)? What about INT_MAX? What about 0?
Using arbitrary indices isn't safe, because the implementation could be already using them for something else. Some replies on the reflector suggested the only reliable argument is one obtained from ios_base::xalloc(). Others pointed out that the iwords and pwords could be stored in sparse arrays, so that any value from INT_MIN to INT_MAX could be a valid key (which might require the implementation to use keys outside that range for its own entries in the arrays). If it's undefined we should add a Requires element to the spec. If invalid indices are supposed to cause a failure we need to define which indices are invalid (and ensure that's something the implementation can check), and specify that it causes a failure.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2018-06-12 01:05:16 | admin | set | messages: + msg9889 |
2018-06-12 01:05:16 | admin | set | status: voting -> wp |
2018-05-06 19:23:13 | admin | set | status: ready -> voting |
2018-03-31 12:03:51 | admin | set | messages: + msg9792 |
2018-03-31 12:03:51 | admin | set | status: new -> ready |
2018-03-24 21:44:42 | admin | set | messages: + msg9775 |
2018-03-16 00:00:00 | admin | create |