mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 23:20:05 +02:00
STYLE: Pefer = default to explicitly trivial implementations
This check replaces default bodies of special member functions with = default;. The explicitly defaulted function declarations enable more opportunities in optimization, because the compiler might treat explicitly defaulted functions as trivial. Additionally, the C++11 use of = default more clearly expreses the intent for the special member functions. 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-equals-default -header-filter=.* -fix
This commit is contained in:

committed by
Hans Johnson

parent
e817e4fc25
commit
e3e05c7085
@@ -205,9 +205,9 @@ TestResult& TestResult::operator<<(bool value) {
|
||||
// class TestCase
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
|
||||
TestCase::TestCase() {}
|
||||
TestCase::TestCase() = default;
|
||||
|
||||
TestCase::~TestCase() {}
|
||||
TestCase::~TestCase() = default;
|
||||
|
||||
void TestCase::run(TestResult& result) {
|
||||
result_ = &result;
|
||||
@@ -217,7 +217,7 @@ void TestCase::run(TestResult& result) {
|
||||
// class Runner
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
|
||||
Runner::Runner() {}
|
||||
Runner::Runner() = default;
|
||||
|
||||
Runner& Runner::add(TestCaseFactory factory) {
|
||||
tests_.push_back(factory);
|
||||
|
@@ -1332,7 +1332,7 @@ void ValueTest::checkMemberCount(Json::Value& value,
|
||||
|
||||
ValueTest::IsCheck::IsCheck()
|
||||
|
||||
{}
|
||||
= default;
|
||||
|
||||
void ValueTest::checkIs(const Json::Value& value, const IsCheck& check) {
|
||||
JSONTEST_ASSERT_EQUAL(check.isObject_, value.isObject());
|
||||
|
Reference in New Issue
Block a user