File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010BasicStringBuilder<T>::UnsafeAppend(std::basic_string_view<T> src) noexcept
1111{
1212 p = std::copy (src.begin (), src.end (), p);
13- *p = SENTINEL;
1413}
1514
1615template <typename T>
1716void
1817BasicStringBuilder<T>::UnsafeFill(T ch, std::size_t n) noexcept
1918{
2019 p = std::fill_n (p, n, ch);
21- *p = SENTINEL;
2220}
2321
2422template class BasicStringBuilder <char >;
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ class BasicStringBuilder {
2626 pointer p;
2727 const pointer end;
2828
29- static constexpr value_type SENTINEL = ' \0 ' ;
30-
3129public:
3230 [[nodiscard]]
3331 explicit constexpr BasicStringBuilder (std::span<value_type> b) noexcept
@@ -42,7 +40,7 @@ public:
4240 }
4341
4442 constexpr bool IsFull () const noexcept {
45- return p >= end - 1 ;
43+ return p >= end;
4644 }
4745
4846 [[nodiscard]]
@@ -55,7 +53,7 @@ public:
5553 }
5654
5755 constexpr bool CanAppend (size_type length) const noexcept {
58- return p + length < end;
56+ return p + length <= end;
5957 }
6058
6159 constexpr void CheckAppend (size_type length) const {
@@ -65,7 +63,6 @@ public:
6563
6664 constexpr void UnsafeAppend (T ch) noexcept {
6765 *p++ = ch;
68- *p = SENTINEL;
6966 }
7067
7168 [[nodiscard]]
You can’t perform that action at this time.
0 commit comments