1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01: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); ss_.str(dlast);
} }
/*
// here we are hitting a g++ bug (Bug 56480) // here we are hitting a g++ bug (Bug 56480)
// compiles fine with clang // compiles fine with clang
// have to wrap in the Grid namespace // have to wrap in the Grid namespace
@ -79,13 +79,16 @@ namespace Grid
template<> template<>
void JSONWriter::writeDefault(const std::string &s, const std::string &x) 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()) if (s.size())
ss_ << "\""<< s << "\" : \"" << x << "\" ," ; ss_ << "\""<< s << "\" : \"" << os.str() << "\" ," ;
else else
ss_ << "\"" << x << "\" ," ; ss_ << os.str() << " ," ;
} }
}// namespace Grid }// namespace Grid
*/
// Reader implementation /////////////////////////////////////////////////////// // Reader implementation ///////////////////////////////////////////////////////
JSONReader::JSONReader(const string &fileName) JSONReader::JSONReader(const string &fileName)

View File

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