mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
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:
parent
30b1641ff4
commit
05bf567dcb
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user