aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/scope.h
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /util/generic/scope.h
parent8cbc307de0221f84c80c42dcbe07d40727537e2c (diff)
downloadydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/scope.h')
-rw-r--r--util/generic/scope.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/scope.h b/util/generic/scope.h
index a54ffc26447..b2c33af61e7 100644
--- a/util/generic/scope.h
+++ b/util/generic/scope.h
@@ -38,28 +38,28 @@ namespace NPrivate {
};
}
-// \brief `Y_SCOPE_EXIT(captures) { body };`
-//
-// General implementaion of RAII idiom (resource acquisition is initialization). Executes
-// function upon return from the current scope.
-//
+// \brief `Y_SCOPE_EXIT(captures) { body };`
+//
+// General implementaion of RAII idiom (resource acquisition is initialization). Executes
+// function upon return from the current scope.
+//
// @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.
+// @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
-
-// \brief `Y_DEFER { body };`
-//
-// Same as `Y_SCOPE_EXIT` but doesn't require user to provide capture-list explicitly (it
+
+// \brief `Y_DEFER { body };`
+//
+// Same as `Y_SCOPE_EXIT` but doesn't require user to provide capture-list explicitly (it
// implicitly uses `[&]` capture). Have same requirements for `body`.
-//
-// Inspired by `defer` statement in languages like Swift and Go.
-//
-// \code
-// auto item = s.pop();
-// bool ok = false;
-// Y_DEFER { if (!ok) { s.push(std::move(item)); } };
-// ... try handle `item` ...
-// ok = true;
-// \endcode
+//
+// Inspired by `defer` statement in languages like Swift and Go.
+//
+// \code
+// auto item = s.pop();
+// bool ok = false;
+// Y_DEFER { if (!ok) { s.push(std::move(item)); } };
+// ... try handle `item` ...
+// ok = true;
+// \endcode
#define Y_DEFER Y_SCOPE_EXIT(&)