Skip to content

Commit 7e62898

Browse files
Dawn Perchikzygoloid
authored andcommitted
LWG3075 basic_string needs deduction guides from basic_string_view
1 parent 3274bc3 commit 7e62898

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

source/strings.tex

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,29 @@
11501150
-> basic_string<typename iterator_traits<InputIterator>::value_type,
11511151
char_traits<typename iterator_traits<InputIterator>::value_type>,
11521152
Allocator>;
1153+
1154+
template<class charT,
1155+
class traits,
1156+
class Allocator = allocator<charT>>
1157+
explicit basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator())
1158+
-> basic_string<charT, traits, Allocator>;
1159+
1160+
template<class charT,
1161+
class traits,
1162+
class Allocator = allocator<charT>>
1163+
basic_string(basic_string_view<charT, traits>,
1164+
typename @\seebelow@::size_type, typename @\seebelow@::size_type,
1165+
const Allocator& = Allocator())
1166+
-> basic_string<charT, traits, Allocator>;
11531167
}
11541168
\end{codeblock}
11551169

1170+
\pnum
1171+
A \tcode{size_type} parameter type in
1172+
a \tcode{basic_string} deduction guide
1173+
refers to the \tcode{size_type} member type of
1174+
the type deduced by the deduction guide.
1175+
11561176
\rSec3[string.require]{General requirements}
11571177

11581178
\pnum
@@ -1458,6 +1478,29 @@
14581478
or if \tcode{Allocator} is a type that does not qualify as an allocator\iref{container.requirements.general}.
14591479
\end{itemdescr}
14601480

1481+
\begin{itemdecl}
1482+
template<class charT,
1483+
class traits,
1484+
class Allocator = allocator<charT>>
1485+
explicit basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator())
1486+
-> basic_string<charT, traits, Allocator>;
1487+
1488+
template<class charT,
1489+
class traits,
1490+
class Allocator = allocator<charT>>
1491+
basic_string(basic_string_view<charT, traits>,
1492+
typename @\seebelow@::size_type, typename @\seebelow@::size_type,
1493+
const Allocator& = Allocator())
1494+
-> basic_string<charT, traits, Allocator>;
1495+
\end{itemdecl}
1496+
1497+
\begin{itemdescr}
1498+
\pnum
1499+
\remarks Shall not participate in overload resolution if
1500+
\tcode{Allocator} is a type that does not qualify as
1501+
an allocator\iref{container.requirements.general}.
1502+
\end{itemdescr}
1503+
14611504
\indexlibrarymember{operator=}{basic_string}%
14621505
\begin{itemdecl}
14631506
basic_string& operator=(const basic_string& str);

0 commit comments

Comments
 (0)