| 231 | typename T |
| 232 | > |
| 233 | const std::string cast_to_string ( |
| 234 | const T& item |
| 235 | ) |
| 236 | { |
| 237 | std::ostringstream sout; |
| 238 | sout << item; |
| 239 | if (!sout) |
| 240 | throw cast_to_string_error(); |
| 241 | return sout.str(); |
| 242 | } |
| 243 | |
| 244 | // don't declare this if we are using mingw because it apparently doesn't |
| 245 | // support iostreams with wchar_t? |