From d11732043ab12e0fbd9fa71cb546c8ac14ebf93a Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Mon, 14 Jan 2019 17:09:29 -0600 Subject: [PATCH] STYLE: Pefer = delete to explicitly trivial implementations This check replaces undefined special member functions with = delete;. The explicitly deleted function declarations enable more opportunities in optimization, because the compiler might treat explicitly delted functions as noops. Additionally, the C++11 use of = delete 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-delete -header-filter=.* -fix --- src/test_lib_json/jsontest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test_lib_json/jsontest.h b/src/test_lib_json/jsontest.h index 7650422..85952a5 100644 --- a/src/test_lib_json/jsontest.h +++ b/src/test_lib_json/jsontest.h @@ -162,8 +162,8 @@ public: static void printUsage(const char* appName); private: // prevents copy construction and assignment - Runner(const Runner& other); - Runner& operator=(const Runner& other); + Runner(const Runner& other) = delete; + Runner& operator=(const Runner& other) = delete; private: void listTests() const;