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.
This commit is contained in:
Tamir Bahar 2018-02-14 03:28:21 +02:00 committed by Neil MacIntosh
parent 30b1641ff4
commit 05bf567dcb

View File

@ -48,7 +48,7 @@ template <class F>
class final_action class final_action
{ {
public: 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_) final_action(final_action&& other) noexcept : f_(std::move(other.f_)), invoke_(other.invoke_)
{ {
@ -65,7 +65,7 @@ public:
private: private:
F f_; F f_;
bool invoke_; bool invoke_ {true};
}; };
// finally() - convenience function to generate a final_action // finally() - convenience function to generate a final_action