File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,10 @@ class [[nodiscard]] CharStringT {
179179 _FORCE_INLINE_ const T *ptr () const { return _cowdata.ptr (); }
180180 _FORCE_INLINE_ const T *get_data () const { return size () ? ptr () : &_null; }
181181
182+ // Returns the number of characters in the buffer, including the terminating NUL character.
183+ // In most cases, length() should be used instead.
182184 _FORCE_INLINE_ int size () const { return _cowdata.size (); }
185+ // Returns the number of characters in the string (excluding terminating NUL character).
183186 _FORCE_INLINE_ int length () const { return size () ? size () - 1 : 0 ; }
184187 _FORCE_INLINE_ bool is_empty () const { return length () == 0 ; }
185188
@@ -299,7 +302,10 @@ class [[nodiscard]] String {
299302 _FORCE_INLINE_ const char32_t *ptr () const { return _cowdata.ptr (); }
300303 _FORCE_INLINE_ const char32_t *get_data () const { return size () ? ptr () : &_null; }
301304
305+ // Returns the number of characters in the buffer, including the terminating NUL character.
306+ // In most cases, length() should be used instead.
302307 _FORCE_INLINE_ int size () const { return _cowdata.size (); }
308+ // Returns the number of characters in the string (excluding terminating NUL character).
303309 _FORCE_INLINE_ int length () const { return size () ? size () - 1 : 0 ; }
304310 _FORCE_INLINE_ bool is_empty () const { return length () == 0 ; }
305311
You can’t perform that action at this time.
0 commit comments