bsnes/nall - fix dangling references bug in stringify

This commit is contained in:
zeromus 2015-06-18 03:05:39 +00:00
parent 0d2830f616
commit 95a7062fad
1 changed files with 6 additions and 2 deletions

View File

@ -131,13 +131,17 @@ template<> struct stringify<const char*> {
};
template<> struct stringify<string> {
const string &value;
//zero 17-jun-2015 - this is a bug. dangling reference can and will go out of scope
//const string &value;
string value;
operator const char*() const { return value; }
stringify(const string &value) : value(value) {}
};
template<> struct stringify<const string&> {
const string &value;
//zero 17-jun-2015 - this is a bug. dangling reference can and will go out of scope
//const string &value;
string value;
operator const char*() const { return value; }
stringify(const string &value) : value(value) {}
};