Title
"Distance" template parameter is underspecified
Status
new
Section
[iterator.operations][alg.random.sample]
Submitter
Jens Maurer

Created on 2020-05-01.00:00:00 last changed 3 days ago

Messages

Date: 2020-05-15.00:00:00

[ 2020-05-09; Reflector prioritization ]

Set priority to 3 after reflector discussions.

Date: 2025-10-15.00:00:00

[ 2025-10-10; Jonathan comments ]

The SGI STL has the requirement that "`Distance` is an integral type that is convertible to `InputIterator`'s distance type." But the SGI STL also required that `Size` arguments to `fill_n` etc. have integral types, and the standard only requires them to be convertible to integral types. Presumably that relaxation was intentional.

Date: 2020-05-01.00:00:00

The library specification conveys pre-concept requirements on template parameters by naming, e.g. "InputIterator".

There is no general specification for template parameters named "Distance", as used by std::advance (see [iterator.operations]). When addressing this omission, the local restriction in [alg.random.sample] could possibly be removed.

See the related issue 3213 for the Size template parameter.

History
Date User Action Args
2025-10-10 21:37:33adminsetmessages: + msg15143
2020-05-09 19:23:21adminsetmessages: + msg11276
2020-05-01 00:00:00admincreate