diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-30 18:13:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-30 18:13:21 +0000 |
commit | 7466d62733bffe5cb040f37b21c5a9a4ad174353 (patch) | |
tree | 10d7bd92bb71816d77d6df3499415ad9575f92e7 /util/generic/scope.h | |
parent | d7f99d9336ffa2fd5e9340c9b1d62fb767d70e9a (diff) | |
parent | 331f05c2e8cac3dc77c994803ae0721bf33b37a6 (diff) | |
download | ydb-7466d62733bffe5cb040f37b21c5a9a4ad174353.tar.gz |
Merge pull request #12145 from ydb-platform/mergelibs-241129-1330
Library import 241129-1330
Diffstat (limited to 'util/generic/scope.h')
-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 };` // |