C++11 changes to a string

Source: Internet
Author: User

element is guaranteed to be stored continuously.
Operator[] such as invalidate iterator, so cow not
is no longer container so swap does not have to comply with rules that cannot copy/move/swap elements, so SSO works
Reference is no longer allocator::reference, and is directly value_type&
S[s.size ()] Whether it's a const version or not.
C_STR () and data () become exactly the same, and there will always be '/' at the end.
In combination with the requirements of C_STR () and opeartor[], basically internal storage must be guaranteed to have at least size () +1 of space, or not give this '
C_str ()/data () No description of the return value being invalidated after any Non-const member function is called, combined
Iterator invalidation that part of the request that operator[]/at/front/back/begin/end that bunch won't
Causes the return value of the C_str/data to expire, you can continue to use

C++11 changes to a string

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.