Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 675663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:50:34+00:00 2026-05-14T00:50:34+00:00

They’re both resizable arrays, and std::basic_string doesn’t have any specifically character-related functions like upper().

  • 0

They’re both resizable arrays, and std::basic_string doesn’t have any specifically character-related functions like upper(). What’s special about string to make it better for character data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:50:34+00:00Added an answer on May 14, 2026 at 12:50 am

    Most of the reason has to do with localization and internationalization (L10I18),performance and for historical reasons.

    For the L10I18 issues, char_traits was added, and you will note that streams has these as well. The intent was to make “smarter characters” in a way, but the outcome was useless. About the only thing char_traits is good for is to specialize some of the std::string/wstring compares, copies, etc as compiler intrinsics.

    The failure is mostly due to UNIX streams themselves, which see the character as the main “atom” where in GUIs, web etc that are internationalized the string is the main “atom.” In other words, in C/C++ land, we have “dumb arrays of smart characters” for strings, whereas every other language uses “smart arrays of dumb characters.” Unicode takes the latter approach.

    Another big difference between basic_string and vector — basic_string can only contain POD types. This can make a difference in some cases somoetime the compiler has an easier time optimizing basic_string compared to vector.

    basic_string sometimes has many other optimization, such as Copy on Write and Small String Optimization. These vary from one implementation to the next.

    However probably the most reason there are two things nearly the same is historical: strings predates the STL quite a bit, and most of the work seemed to center on making them interoperate with IOStream library. One C++ Urban Myth is that STL is a “container library” that was added to C++. It is not, and to get it adopted into C++, containers were added. An “STL Interface” was also bolted onto the existing string class. std::vector was largely taken from a vector implemenation that existed in the AdaSTL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

They seem to be equal. Can both have multiple keys separated by a comma.
They're both raised once after the mouse button is released and both can have
They have states for things like pressed, focused, disabled, but is it possible to
They both seem to be sending data to the server inside the body, so
They both seem to fulfill the same purpose. When would I chose one over
They both do the same thing. Is one way better? Obviously if I write
What are they and what are they good for? I do not have a
They both inherit ViewAnimator . I know that ViewSwitcher allows only two views, while
They both mean new line but when is one used over the other?
Seems they both let you retrieve the minimum, which is what I need for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.