Skip to content

Commit 98d6498

Browse files
authored
fix random_access_iterator
1 parent fa64485 commit 98d6498

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

basic_string.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ namespace bizwen
10091009
requires ::std::input_iterator<InputIt>
10101010
constexpr basic_string(InputIt first, InputIt last)
10111011
{
1012-
if constexpr (::std::forward_iterator<InputIt>)
1012+
if constexpr (::std::random_access_iterator<InputIt>)
10131013
{
10141014
auto length = ::std::ranges::distance(first, last);
10151015
allocate_plus_one_(length);
@@ -1159,7 +1159,7 @@ namespace bizwen
11591159
requires ::std::input_iterator<InputIt>
11601160
constexpr basic_string& append(InputIt first, InputIt last)
11611161
{
1162-
if constexpr (::std::forward_iterator<InputIt>)
1162+
if constexpr (::std::random_access_iterator<InputIt>)
11631163
{
11641164
auto size = size_();
11651165
auto length = ::std::ranges::distance(first, last);
@@ -1847,7 +1847,7 @@ namespace bizwen
18471847
auto end = end_();
18481848
auto index = start - begin_();
18491849

1850-
if constexpr (::std::forward_iterator<InputIt>)
1850+
if constexpr (::std::random_access_iterator<InputIt>)
18511851
{
18521852
auto length = ::std::distance(first, last);
18531853
reserve(size + length);

0 commit comments

Comments
 (0)