Skip to content

Commit 71c3a79

Browse files
committed
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
1 parent 9110205 commit 71c3a79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/test_lib_json/jsontest.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ class Runner {
162162
static void printUsage(const char* appName);
163163

164164
private: // prevents copy construction and assignment
165-
Runner(const Runner& other);
166-
Runner& operator=(const Runner& other);
165+
Runner(const Runner& other) = delete;
166+
Runner& operator=(const Runner& other) = delete;
167167

168168
private:
169169
void listTests() const;

0 commit comments

Comments
 (0)