Skip to content

Commit da7bf2a

Browse files
committed
New issue from Jan Schultke: "§[algorithms.requirements] It is unclear what an algorithm is"
1 parent f909dd7 commit da7bf2a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

xml/issue4277.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4277" status="New">
5+
<title>&sect;[algorithms.requirements] It is unclear what an algorithm is</title>
6+
<section>
7+
<sref ref="[algorithms.requirements]"/>
8+
</section>
9+
<submitter>Jan Schultke</submitter>
10+
<date>08 Jun 2025</date>
11+
<priority>99</priority>
12+
13+
<discussion>
14+
<p>
15+
<sref ref="[algorithms.requirements]"/> paragraph 15 states:
16+
</p>
17+
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
18+
<p>
19+
The well-formedness and behavior of a call to an algorithm with an explicitly-specified
20+
template argument list is unspecified, except where explicitly stated otherwise.
21+
</p>
22+
</blockquote>
23+
<p>
24+
It is unclear what this applies to because "algorithm" is never defined. <sref ref="[algorithms.requirements]"/>
25+
paragraph 1 uses the term while mentioning iterators and containers, but <sref ref="[algorithm]"/> specifies
26+
function templates such as `std::gcd` which do not accept iterators.
27+
<p/>
28+
The <i>Remarks</i> specifications in <sref ref="[alg.min.max]"/> providing exemptions from
29+
<sref ref="[algorithms.requirements]"/> paragraph 15 suggest that even function templates not
30+
accepting iterators are considered algorithms.
31+
</p>
32+
</discussion>
33+
34+
<resolution>
35+
<p>
36+
This wording is relative to <paper num="N5008"/>.
37+
</p>
38+
39+
<ol>
40+
<li><p>Modify <sref ref="[algorithms.requirements]"/> as indicated:</p>
41+
42+
<blockquote>
43+
<p>
44+
-15- The well-formedness and behavior of a call to <del>an algorithm</del><ins>a function template specified in Clause
45+
<sref ref="[algorithms]"/> (including call operators of algorithm function objects denoted as algorithms throughout Clause
46+
<sref ref="[algorithms.requirements]"/>)</ins> with an explicitly-specified template argument list is unspecified,
47+
except where explicitly stated otherwise.
48+
<p/>
49+
[<i>Note 3</i>: Consequently, an implementation can declare an algorithm with different template parameters than those
50+
presented. &mdash; <i>end note</i>]
51+
</p>
52+
</blockquote>
53+
</li>
54+
55+
</ol>
56+
</resolution>
57+
58+
</issue>

0 commit comments

Comments
 (0)