File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88template <typename T>
99void
10- BasicStringBuilder<T>::Append (std::basic_string_view<T> src)
10+ BasicStringBuilder<T>::UnsafeAppend (std::basic_string_view<T> src) noexcept
1111{
12- CheckAppend (src.size ());
1312 p = std::copy (src.begin (), src.end (), p);
1413 *p = SENTINEL;
1514}
Original file line number Diff line number Diff line change @@ -63,14 +63,26 @@ public:
6363 throw TooLargeError{};
6464 }
6565
66- constexpr void Append (T ch) {
67- CheckAppend (1 );
68-
66+ constexpr void UnsafeAppend (T ch) noexcept {
6967 *p++ = ch;
7068 *p = SENTINEL;
7169 }
7270
73- void Append (std::basic_string_view<T> src);
71+ constexpr void Append (T ch) {
72+ CheckAppend (1 );
73+ UnsafeAppend (ch);
74+ }
75+
76+ /* *
77+ * Like Append(), but do not check whether there is enough
78+ * space in the buffer.
79+ */
80+ void UnsafeAppend (std::basic_string_view<T> src) noexcept ;
81+
82+ void Append (std::basic_string_view<T> src) {
83+ CheckAppend (src.size ());
84+ UnsafeAppend (src);
85+ }
7486};
7587
7688class StringBuilder : public BasicStringBuilder <char > {
You can’t perform that action at this time.
0 commit comments