
-----------------------------------
wtd
Tue Mar 16, 2004 8:50 pm

[C++] String Composing Tip
-----------------------------------
For composing long strings the temptation is to use the std::string class and its + operator.  However, this results in a temporary std::string object being created each time the operator is used.  Sometimes compilers can optimize this away, but it shouldn't be counted on.

Instead use the std::stringstream class.

#include 
#include 

int main()
{
   std::stringstream ss;

   ss 