1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Fix gcc error on JSON compilation

This commit is contained in:
Guido Cossu 2017-07-12 14:55:42 +01:00
parent 2a35449b91
commit f64fb7bd77
2 changed files with 9 additions and 5 deletions

View File

@ -69,7 +69,7 @@ void JSONWriter::delete_comma()
ss_.str(dlast);
}
/*
// here we are hitting a g++ bug (Bug 56480)
// compiles fine with clang
// have to wrap in the Grid namespace
@ -79,13 +79,16 @@ namespace Grid
template<>
void JSONWriter::writeDefault(const std::string &s, const std::string &x)
{
//std::cout << "JSONWriter::writeDefault(string) : " << s << std::endl;
std::ostringstream os;
os << std::boolalpha << x;
if (s.size())
ss_ << "\""<< s << "\" : \"" << x << "\" ," ;
ss_ << "\""<< s << "\" : \"" << os.str() << "\" ," ;
else
ss_ << "\"" << x << "\" ," ;
ss_ << os.str() << " ," ;
}
}// namespace Grid
*/
// Reader implementation ///////////////////////////////////////////////////////
JSONReader::JSONReader(const string &fileName)

View File

@ -120,6 +120,7 @@ namespace Grid
ss_ << os.str() << " ," ;
}
/*
// specialize for string
template <>
void JSONWriter::writeDefault(const std::string &s, const std::string &x)
@ -132,7 +133,7 @@ namespace Grid
else
ss_ << os.str() << " ," ;
}
*/
template <typename U>