From ef2b7da0baa5878aaa5faf7bf5cc39559ce803cf Mon Sep 17 00:00:00 2001 From: Florian Franzmann Date: Sun, 1 Dec 2019 17:45:48 +0100 Subject: [PATCH 06/35] Cleanup: default-initialize variables --- sample.cpp | 2 +- tests.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample.cpp b/sample.cpp index 41ac979..916286d 100644 --- a/sample.cpp +++ b/sample.cpp @@ -17,7 +17,7 @@ class Person{ } public: string name; - double age; + double age{}; vector bio; }; diff --git a/tests.cpp b/tests.cpp index 011f8e5..f8c6d8b 100644 --- a/tests.cpp +++ b/tests.cpp @@ -22,8 +22,8 @@ class B{ public: string name; - double weight; - int height; + double weight{}; + int height{}; }; class A{ @@ -40,7 +40,7 @@ class A{ } public: - int i; + int i{}; string s; vector< pair > vi; set< double > seti; -- 2.24.0 .