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 @@ -180,7 +180,10 @@ class [[nodiscard]] CharStringT {
180180 _FORCE_INLINE_ const T *ptr () const { return _cowdata.ptr (); }
181181 _FORCE_INLINE_ const T *get_data () const { return size () ? ptr () : &_null; }
182182
183+ // Returns the number of characters in the buffer, including the terminating NUL character.
184+ // In most cases, length() should be used instead.
183185 _FORCE_INLINE_ int size () const { return _cowdata.size (); }
186+ // Returns the number of characters in the string (excluding terminating NUL character).
184187 _FORCE_INLINE_ int length () const { return size () ? size () - 1 : 0 ; }
185188 _FORCE_INLINE_ bool is_empty () const { return length () == 0 ; }
186189
@@ -302,7 +305,10 @@ class [[nodiscard]] String {
302305 _FORCE_INLINE_ const char32_t *ptr () const { return _cowdata.ptr (); }
303306 _FORCE_INLINE_ const char32_t *get_data () const { return size () ? ptr () : &_null; }
304307
308+ // Returns the number of characters in the buffer, including the terminating NUL character.
309+ // In most cases, length() should be used instead.
305310 _FORCE_INLINE_ int size () const { return _cowdata.size (); }
311+ // Returns the number of characters in the string (excluding terminating NUL character).
306312 _FORCE_INLINE_ int length () const { return size () ? size () - 1 : 0 ; }
307313 _FORCE_INLINE_ bool is_empty () const { return length () == 0 ; }
308314
You can’t perform that action at this time.
0 commit comments