diff options
author | vtrunov <vtrunov@yandex-team.com> | 2024-11-28 23:02:49 +0300 |
---|---|---|
committer | vtrunov <vtrunov@yandex-team.com> | 2024-11-28 23:13:17 +0300 |
commit | e42bacc5e724fb1e3e840deaeef6b576c04cafa3 (patch) | |
tree | cda56f57c057c41ac308d0c055c501715222da65 | |
parent | 89009c27bd774731c1947b303aed452ff8c7a0d0 (diff) | |
download | ydb-e42bacc5e724fb1e3e840deaeef6b576c04cafa3.tar.gz |
removed redundant code after CTAD c++-17 feature
commit_hash:6f4c98369177b376ac1c9dfba18ee5464c558c95
-rw-r--r-- | util/generic/scope.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/util/generic/scope.h b/util/generic/scope.h index 0761e2962f..8c5a63090e 100644 --- a/util/generic/scope.h +++ b/util/generic/scope.h @@ -29,13 +29,6 @@ namespace NPrivate { private: F Function_; }; - - struct TMakeGuardHelper { - template <class F> - TScopeGuard<F> operator|(F&& function) const { - return std::forward<F>(function); - } - }; } // namespace NPrivate // \brief `Y_SCOPE_EXIT(captures) { body };` @@ -46,7 +39,7 @@ namespace NPrivate { // @note expects `body` to provide no-throw guarantee, otherwise whenever an exception // is thrown and leaves the outermost block of `body`, the function `std::terminate` is called. // @see http://drdobbs.com/184403758 for detailed motivation. -#define Y_SCOPE_EXIT(...) const auto Y_GENERATE_UNIQUE_ID(scopeGuard) Y_DECLARE_UNUSED = ::NPrivate::TMakeGuardHelper{} | [__VA_ARGS__]() mutable -> void +#define Y_SCOPE_EXIT(...) const ::NPrivate::TScopeGuard Y_GENERATE_UNIQUE_ID(scopeGuard) Y_DECLARE_UNUSED = [__VA_ARGS__]() mutable -> void // \brief `Y_DEFER { body };` // |