Skip to content

Commit ffca446

Browse files
authored
Merge 2023-06 LWG Motion 24
P2697R1 Interfacing bitset with string_view
2 parents 10c7120 + af89968 commit ffca446

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@
580580
#define @\defnlibxname{cpp_lib_bind_front}@ 201907L // freestanding, also in \libheader{functional}
581581
#define @\defnlibxname{cpp_lib_bit_cast}@ 201806L // freestanding, also in \libheader{bit}
582582
#define @\defnlibxname{cpp_lib_bitops}@ 201907L // freestanding, also in \libheader{bit}
583+
#define @\defnlibxname{cpp_lib_bitset}@ 202306L // also in \libheader{bitset}
583584
#define @\defnlibxname{cpp_lib_bool_constant}@ 201505L // freestanding, also in \libheader{type_traits}
584585
#define @\defnlibxname{cpp_lib_bounded_array_traits}@ 201902L // freestanding, also in \libheader{type_traits}
585586
#define @\defnlibxname{cpp_lib_boyer_moore_searcher}@ 201603L // also in \libheader{functional}

source/utilities.tex

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9687,10 +9687,18 @@
96879687
= basic_string<charT, traits, Allocator>::npos,
96889688
charT zero = charT('0'),
96899689
charT one = charT('1'));
9690+
template<class charT, class traits>
9691+
constexpr explicit bitset(
9692+
basic_string_view<charT, traits> str,
9693+
typename basic_string_view<charT, traits>::size_type pos = 0,
9694+
typename basic_string_view<charT, traits>::size_type n
9695+
= basic_string_view<charT, traits>::npos,
9696+
charT zero = charT('0'),
9697+
charT one = charT('1'));
96909698
template<class charT>
96919699
constexpr explicit bitset(
96929700
const charT* str,
9693-
typename basic_string<charT>::size_type n = basic_string<charT>::npos,
9701+
typename basic_string_view<charT>::size_type n = basic_string_view<charT>::npos,
96949702
charT zero = charT('0'),
96959703
charT one = charT('1'));
96969704

@@ -9823,6 +9831,14 @@
98239831
= basic_string<charT, traits, Allocator>::npos,
98249832
charT zero = charT('0'),
98259833
charT one = charT('1'));
9834+
template<class charT, class traits>
9835+
constexpr explicit bitset(
9836+
basic_string_view<charT, traits> str,
9837+
typename basic_string_view<charT, traits>::size_type pos = 0,
9838+
typename basic_string_view<charT, traits>::size_type n
9839+
= basic_string_view<charT, traits>::npos,
9840+
charT zero = charT('0'),
9841+
charT one = charT('1'));
98269842
\end{itemdecl}
98279843

98289844
\begin{itemdescr}
@@ -9869,7 +9885,7 @@
98699885
template<class charT>
98709886
constexpr explicit bitset(
98719887
const charT* str,
9872-
typename basic_string<charT>::size_type n = basic_string<charT>::npos,
9888+
typename basic_string_view<charT>::size_type n = basic_string_view<charT>::npos,
98739889
charT zero = charT('0'),
98749890
charT one = charT('1'));
98759891
\end{itemdecl}
@@ -9879,9 +9895,9 @@
98799895
\effects
98809896
As if by:
98819897
\begin{codeblock}
9882-
bitset(n == basic_string<charT>::npos
9883-
? basic_string<charT>(str)
9884-
: basic_string<charT>(str, n),
9898+
bitset(n == basic_string_view<charT>::npos
9899+
? basic_string_view<charT>(str)
9900+
: basic_string_view<charT>(str, n),
98859901
0, n, zero, one)
98869902
\end{codeblock}
98879903
\end{itemdescr}

0 commit comments

Comments
 (0)