From 518cad65a4ddbe9c7f8d240344bb15502f4896f8 Mon Sep 17 00:00:00 2001 From: Treb Connell Date: Fri, 2 Oct 2015 15:14:39 -0700 Subject: [PATCH] rename no_action and bring it out into detail namespace --- include/gsl.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/gsl.h b/include/gsl.h index 0477c02..6da10c4 100644 --- a/include/gsl.h +++ b/include/gsl.h @@ -73,6 +73,11 @@ using owner = T; // GSL.util: utilities // +namespace detail +{ + void no_action() noexcept {} +} + // final_act allows you to ensure something gets run at the end of a scope template class final_act @@ -80,7 +85,7 @@ class final_act public: explicit final_act(F f) noexcept : f_(std::move(f)) {} - final_act(final_act&& other) noexcept : f_(std::move(other.f_)) { other.f_ = NoAction; } + final_act(final_act&& other) noexcept : f_(std::move(other.f_)) { other.f_ = detail::no_action; } final_act(const final_act&) = delete; final_act& operator=(const final_act&) = delete; @@ -88,8 +93,6 @@ public: private: F f_; - - static void NoAction(){} }; // finally() - convenience function to generate a final_act