Skip to content

Commit 866bb48

Browse files
committed
New issue from Jonathan: Should flat adaptors use insert_range when available?
1 parent 79a1f4d commit 866bb48

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

xml/issue4350.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4350" status="New">
5+
<title>Should flat adaptors use `insert_range` when available?</title>
6+
<section>
7+
<sref ref="[flat.map]"/>
8+
<sref ref="[flat.multimap]"/>
9+
<sref ref="[flat.set]"/>
10+
<sref ref="[flat.multiset]"/>
11+
</section>
12+
<submitter>Jonathan Wakely</submitter>
13+
<date>05 Sep 2025</date>
14+
<priority>99</priority>
15+
16+
<discussion>
17+
<p>
18+
As specified in <sref ref="[queue.mod]"/>,
19+
`std::queue::push_range` is guaranteed to use `c.append_range` if that exists.
20+
For `flat_map` and its flat friends, we only ever use `c.insert` and never try
21+
to use `c.insert_range`, `c.append_range`, etc.
22+
LWG thinks the "as if by" wording allows implementations to use `insert_range`
23+
when the container type being adapted is `std::vector` but not for user-defined
24+
containers.
25+
Should the flat adaptors follow `std::queue` and guarantee that they will use
26+
the `xxx_range` member if they exist?
27+
That would mean that user containers need to ensure that any member functions
28+
with those names must behave as expected, but we already require that for
29+
`std::queue`.
30+
</p>
31+
</discussion>
32+
33+
<resolution>
34+
<p>
35+
</p>
36+
</resolution>
37+
38+
</issue>

0 commit comments

Comments
 (0)