STYLE: Use default member initialization
Converts a default constructor’s member initializers into the new
default member initializers in C++11. Other member initializers that match the
default member initializer are removed. This can reduce repeated code or allow
use of ‘= default’.
SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-default-member-init -header-filter=.* -fix
diff --git a/include/json/reader.h b/include/json/reader.h
index 58cb58b..1af5cb0 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -242,14 +242,14 @@
Nodes nodes_;
Errors errors_;
JSONCPP_STRING document_;
- Location begin_;
- Location end_;
- Location current_;
- Location lastValueEnd_;
- Value* lastValue_;
+ Location begin_{};
+ Location end_{};
+ Location current_{};
+ Location lastValueEnd_{};
+ Value* lastValue_{};
JSONCPP_STRING commentsBefore_;
Features features_;
- bool collectComments_;
+ bool collectComments_{};
}; // Reader
/** Interface for reading JSON from a char array.