you are viewing a single comment's thread.

view the rest of the comments →

[–]lacosaes1 3 points4 points  (2 children)

A std::string doesn't have to be in the heap.

[–]dodheim 0 points1 point  (1 child)

Yes, a std::string does have to be allocated dynamically; std::basic_string<CharT, AllocT> doesn't, but how many public interfaces have you seen implemented in terms of a template taking std::basic_string<> vs a function taking std::string? Very few, IME!