Skip to content

Commit 7eca3b4

Browse files
committed
gcc-4.6 (Travis CI) does not support
1 parent 999f591 commit 7eca3b4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/json/writer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
9292
/** \brief How to write comments.
9393
* Default: All
9494
*/
95-
StreamWriter::CommentStyle cs_ = StreamWriter::CommentStyle::All;
95+
StreamWriter::CommentStyle cs_;
9696
/** \brief Write in human-friendly style.
9797
9898
If "", then skip all indentation and newlines.
9999
In that case, you probably want CommentStyle::None also.
100100
Default: "\t"
101101
*/
102-
std::string indentation_ = "\t";
102+
std::string indentation_;
103+
104+
StreamWriterBuilder();
103105

104106
/// Do not take ownership of sout, but maintain a reference.
105107
StreamWriter* newStreamWriter(std::ostream* sout) const;

src/lib_json/json_writer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,10 @@ int MyStreamWriter::write(Value const& root)
961961
}
962962
StreamWriter::Factory::~Factory()
963963
{}
964+
StreamWriterBuilder::StreamWriterBuilder()
965+
: cs_(StreamWriter::CommentStyle::All)
966+
, indentation_("\t")
967+
{}
964968
StreamWriter* StreamWriterBuilder::newStreamWriter(std::ostream* stream) const
965969
{
966970
std::string colonSymbol = " : ";

0 commit comments

Comments
 (0)