When I create a std::string using the default constructor, is ANY memory allocated on the heap? I’m hoping the answer does not depend on the implementation and is standardized. Consider the following:
std::string myString;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Unfortunately, the answer is no according to N3290.
Table 63 Page 643 says:
data()a non-null pointer that is copyable and can have 0 added to itsize()0capacity()an unspecified valueThe table is identical for C++03.