Skip to content
Snippets Groups Projects
Commit c12d406c authored by Brad King's avatar Brad King
Browse files

ERR: Fixed istringstream to work with MSVC 6 old streams.

parent cc3228f6
No related branches found
No related tags found
No related merge requests found
...@@ -95,14 +95,13 @@ class istringstream: private kwsys_stl::string, public istrstream ...@@ -95,14 +95,13 @@ class istringstream: private kwsys_stl::string, public istrstream
public: public:
typedef kwsys_stl::string StdString; typedef kwsys_stl::string StdString;
typedef istrstream IStrStream; typedef istrstream IStrStream;
istringstream(): StdString(), IStrStream(StdString::c_str()) {} istringstream(): StdString(),
IStrStream(const_cast<char*>(StdString::c_str())) {}
istringstream(const kwsys_stl::string& s): istringstream(const kwsys_stl::string& s):
StdString(s), IStrStream(StdString::c_str()) {} StdString(s), IStrStream(const_cast<char*>(StdString::c_str())) {}
kwsys_stl::string str() const { return *this; } kwsys_stl::string str() const { return *this; }
void str(const kwsys_stl::string& s) void str(const kwsys_stl::string& s)
{ {
// Very dangerous. If this throws, the object is hosed. When the
// destructor is later called, the program is hosed too.
this->~istringstream(); this->~istringstream();
new (this) istringstream(s); new (this) istringstream(s);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment