This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
Distance
" template parameter is underspecifiedSection: 24.4.3 [iterator.operations], 26.7.12 [alg.random.sample] Status: New Submitter: Jens Maurer Opened: 2020-05-01 Last modified: 2025-10-10
Priority: 3
View other active issues in [iterator.operations].
View all other issues in [iterator.operations].
View all issues with New status.
Discussion:
The library specification conveys pre-concept requirements on template
parameters by naming, e.g. "InputIterator
".
Distance
",
as used by std::advance
(see 24.4.3 [iterator.operations]).
When addressing this omission, the local restriction in 26.7.12 [alg.random.sample]
could possibly be removed.
See the related issue 3213(i) for the Size
template parameter.
[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.
[2020-05-09; Reflector prioritization]
Set priority to 3 after reflector discussions.
Proposed resolution: