Title
N in ssize(const T (&)[N]) should be size_t
Status
nad
Section
[iterator.range]
Submitter
Nevin Liber

Created on 2019-05-23.00:00:00 last changed 42 months ago

Messages

Date: 2020-11-09.20:22:58

Proposed resolution:

This wording is relative to N4810.

  1. Modify [iterator.range] as indicated:

    template<class T, ptrdiffsize_t N> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept;
    

    -19- Returns: static_cast<ptrdiff_t>(N).

Date: 2020-11-09.00:00:00

[ 2020-11-09 Status changed: Tentatively NAD → NAD. ]

Date: 2019-06-12.00:00:00

[ 2019-06-12 Tentatively NAD after reflector discussion ]

Date: 2019-05-23.00:00:00

The N in ssize(const T (&)[N]) is specified to be of type ptrdiff_t. It should be size_t to be consistent with the rest of the standard library, such as the array overloads for all other range access functions, the swap overload for arrays, and other function template overloads for arrays. (Note: the return type of this function should still be ptrdiff_t.)

History
Date User Action Args
2020-11-09 20:22:58adminsetmessages: + msg11534
2019-06-10 05:16:56adminsetmessages: + msg10436
2019-06-10 05:16:56adminsetstatus: new -> nad
2019-05-27 16:04:42adminsetmessages: + msg10411
2019-05-23 00:00:00admincreate