Namespaces
Variants
Views
Actions

Talk:cpp/string/basic string

From cppreference.com

Contents

[edit] Duplication

Some non-member functions are at the higher-level page and some are here, is that ok? Should all be duplicated here? --Cubbi

I think we can move these functions here. P12 11:40, 12 September 2011 (PDT)

[edit] Errors

The member type pointer is defined as T, which does not seem to make sense, because T is nowhere defined. Should it be CharT* instead?

Yes, that is an error. Thanks. Fixing. --Cubbi 19:06, 13 March 2012 (PDT)

[edit] Missing

Is there a reason the destructor is not listed? Might be helpful to clearly say it is noexcept and has constant complexity.

It is likely missing because it's hard to find in the standard: as far as I can see, it's documented as part of container requirements (and string is documented to satisfy those requirements), and its complexity there is listed as "linear", since container requirements specify a call to allocator_traits::destroy for every element.. actual strings seem to only call deallocate once, though. I wonder if it's been discussed before. --Cubbi (talk) 13:27, 19 October 2016 (PDT)


[edit] Order of Methods

One point is that assign() is in the 'Members' section, while append()/insert() are under 'Operations' What is the reason for that? Second point: Is it okay if I order the methods in 'Operations' alphabetically? I cannot see a logic in the current order. Gemini67 (talk) 06:12, 20 March 2017 (PDT)

you could go farther and regroup/reorder them the way the standard does: iterators, capacity, access, modifiers, operations. See basic.string --Cubbi (talk) 06:34, 20 March 2017 (PDT)

[edit] std::basic_string_view operations

It's hard to find operations that work with std::basic_string_view. May be it's a good idea to rename <class T> parameter to <class StringView>? It would be a good hint. --__vic (talk) 04:48, 7 May 2021 (PDT)