Title
§[algorithms.requirements] It is unclear what an algorithm is
Status
new
Section
[algorithms.requirements]
Submitter
Jan Schultke

Created on 2025-06-08.00:00:00 last changed 2 weeks ago

Messages

Date: 2025-06-14.10:40:36

Proposed resolution:

This wording is relative to N5008.

  1. Modify [algorithms.requirements] as indicated:

    -15- The well-formedness and behavior of a call to an algorithma function template specified in Clause [algorithms] (including call operators of algorithm function objects denoted as algorithms throughout Clause [algorithms.requirements]) with an explicitly-specified template argument list is unspecified, except where explicitly stated otherwise.

    [Note 3: Consequently, an implementation can declare an algorithm with different template parameters than those presented. — end note]

Date: 2025-06-08.00:00:00

[algorithms.requirements] paragraph 15 states:

The well-formedness and behavior of a call to an algorithm with an explicitly-specified template argument list is unspecified, except where explicitly stated otherwise.

It is unclear what this applies to because "algorithm" is never defined. [algorithms.requirements] paragraph 1 uses the term while mentioning iterators and containers, but [algorithm] specifies function templates such as `std::gcd` which do not accept iterators.

The Remarks specifications in [alg.min.max] providing exemptions from [algorithms.requirements] paragraph 15 suggest that even function templates not accepting iterators are considered algorithms.

History
Date User Action Args
2025-06-14 10:40:36adminsetmessages: + msg14830
2025-06-08 00:00:00admincreate