You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`beman.scope` is a C++ library provides `scope_guard` facilities. The library conforms to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md).
12
+
13
+
**Implements**: [D3610R0 Scope Guard](./doc/scope.org) targeted at C++29.
14
+
15
+
**Status**: [Under development and not yet ready for production use.](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_LIBRARY_MATURITY_MODEL.md#under-development-and-not-yet-ready-for-production-use)
16
+
11
17
# Overview
12
18
13
19
During the C++20 cycle [P0052 Generic Scope Guard and RAII Wrapper for the Standard Library](https://wg21.link/P0052)
-[Peter Sommerlad - Woes of Scope Guards and Unique_Resource - 5+ years in the making](https://www.youtube.com/watch?v=O1sK__G5Nrg)
49
-
-[Andrei Alexandrescu - Declarative Control Flow](https://www.youtube.com/watch?v=WjTrfoiB0MQ)
50
-
51
-
# Examples
52
-
53
-
-[TS example of scope_exit](https://godbolt.org/z/T5KhTYjP7)
54
-
55
-
---
56
-
57
-
`beman.scope` is a C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md).
58
-
59
-
**Implements**: D3610R0 Scope Guard for C++29
60
-
61
-
**Status**: [Under development and not yet ready for production use.](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_LIBRARY_MATURITY_MODEL.md#under-development-and-not-yet-ready-for-production-use)
31
+
-[Prior art, papers, related libraries, videos](https://github.com/bemanproject/scope/blob/main/resources.md)
62
32
63
33
## Usage
64
34
35
+
-[](https://godbolt.org/z/qMvrsPexd)
36
+
65
37
The following is an example of using `scope_fail` to trigger and action when the scope
66
38
is exited with an exception. `scope_success` and `scope_exit` provide similar capability
67
39
but with different checked conditions on exiting the scope.
@@ -136,6 +108,7 @@ Build-time dependencies:
136
108
-`cmake`
137
109
-`ninja`, `make`, or another CMake-supported build system
138
110
- CMake defaults to "Unix Makefiles" on POSIX systems
Copy file name to clipboardExpand all lines: paper/scope.org
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@
26
26
27
27
28
28
* Introduction
29
+
- NOTE: This paper is a draft work in progress.
29
30
30
31
During the C++20 cycle [[https://wg21.link/P0052][P0052 Generic Scope Guard and RAII Wrapper for the Standard Library]] was added to LTFSv3. In the intervening time, two standard libraries have implemented support as well as Boost. With the imperative for safety and security in C++, developers need every tool in the toolbox. The authors believe it is time to move this facility into the standard. The paper will re-examine the now five plus year old design and any learning from deployments of the LTFSv3.
0 commit comments