problem of stringstream

Ian Lance Taylor iant@google.com
Tue Aug 25 20:20:00 GMT 2009


李玉北 <leeight@gmail.com> writes:

> i'm using the code snippets
>
> template <class T>
> inline std::string to_string (const T& t)
> {
>     std::stringstream ss;
>     ss << t;
>     return ss.str();
> }
>
> but it cause a core dump sometime.
> this is the backtrack information.
>
> #3  0x000000302d3af59a in operator new () from /usr/lib64/libstdc++.so.6
> No symbol table info available.

A core dump in operator new normally indicates some sort of memory
corruption, often due to using an invalid pointer or overflowing a
buffer.

Ian



More information about the Gcc-help mailing list