From 05bf567dcb2205fa697ab784e848a629b9003cbc Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Wed, 14 Feb 2018 03:28:21 +0200 Subject: [PATCH] Use in-class init for final_action members (C.48) (#601) * Use in-class init for final_action members (C.48) Initialize `invoke_` in-class, according to http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers * Empty commit to trigger build. --- include/gsl/gsl_util | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/gsl/gsl_util b/include/gsl/gsl_util index 40e2229..eee63e7 100644 --- a/include/gsl/gsl_util +++ b/include/gsl/gsl_util @@ -48,7 +48,7 @@ template class final_action { public: - explicit final_action(F f) noexcept : f_(std::move(f)), invoke_(true) {} + explicit final_action(F f) noexcept : f_(std::move(f)) {} final_action(final_action&& other) noexcept : f_(std::move(other.f_)), invoke_(other.invoke_) { @@ -65,7 +65,7 @@ public: private: F f_; - bool invoke_; + bool invoke_ {true}; }; // finally() - convenience function to generate a final_action