What storage does std::string::c_str() use?

From: Vyacheslav Kononenko (vyacheslav_at_kononenko.net)
Date: 09/08/04

Date: 8 Sep 2004 12:39:58 -0700


If I am not mistaken I had some problems with code like this:

std::string foo, bar;
somefunc( foo.c_str(), bar.c_str() );

Problem was that c_str() used buffer shared btw instances of
std::string in that implementation. I did not find anything that
standart would explicitly say about this case. So what would you say?