diff --git a/example/simplereader/simplereader.cpp b/example/simplereader/simplereader.cpp index b47d9b2..edbdb63 100644 --- a/example/simplereader/simplereader.cpp +++ b/example/simplereader/simplereader.cpp @@ -4,7 +4,7 @@ using namespace rapidjson; using namespace std; -struct MyHandler : public BaseReaderHandler, MyHandler> { +struct MyHandler { bool Null() { cout << "Null()" << endl; return true; } bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; } bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; } diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index e853bea..885fe22 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -637,8 +637,10 @@ private: StackStream stackStream(stack_); ParseStringToStream(s, stackStream); RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - const typename TargetEncoding::Ch* const str = stack_.template Pop(stackStream.length_); - success = (isKey ? handler.Key(str, stackStream.length_ - 1, false) : handler.String(str, stackStream.length_ - 1, false)); + success = (isKey + ? handler.Key( stack_.template Pop(stackStream.length_), stackStream.length_ - 1, false) + : handler.String(stack_.template Pop(stackStream.length_), stackStream.length_ - 1, false) + ); } if(!success)