Skip to content

Commit

Permalink
nan support following #300 (see #285)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzothAmmo committed Aug 5, 2016
1 parent 0bfa9ad commit 1e5e648
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/cereal/archives/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ namespace cereal
throw ::cereal::RapidJSONException("rapidjson internal assertion failure: " #x); }
#endif // RAPIDJSON_ASSERT

// Enable support for parsing of nan, inf, -inf
#define CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNanAndInfFlag
#define CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag | kParseNanAndInfFlag

#include <cereal/external/rapidjson/prettywriter.h>
#include <cereal/external/rapidjson/ostreamwrapper.h>
#include <cereal/external/rapidjson/istreamwrapper.h>
Expand Down Expand Up @@ -420,7 +424,7 @@ namespace cereal
itsNextName( nullptr ),
itsReadStream(stream)
{
itsDocument.ParseStream<rapidjson::kParseFullPrecisionFlag>(itsReadStream);
itsDocument.ParseStream<>(itsReadStream);
if (itsDocument.IsArray())
itsIteratorStack.emplace_back(itsDocument.Begin(), itsDocument.End());
else
Expand Down

0 comments on commit 1e5e648

Please sign in to comment.