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 minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md).
12
-
This can be used as a template for those intending to write Beman libraries.
13
-
It may also find use as a minimal and modern C++ project structure.
11
+
# Overview
14
12
15
-
**Implements**: `std::identity` proposed in [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
13
+
During the C++20 cycle [P0052 Generic Scope Guard and RAII Wrapper for the Standard Library](https://wg21.link/P0052) added 4 types: `scope_exit`, `scope_fail`, `scope_success` and `unique_resource` to [LTFSv3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4908#scopeguard). 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 five year old design and any learning from deployment of the LTFSv3.
14
+
15
+
For discussions of this library see:
16
+
17
+
-[Discourse for discussion of scope](https://discourse.bemanproject.org/t/scope-library/315)
18
+
19
+
# Prior And Other Work
20
+
21
+
## Papers
22
+
23
+
- TS design and wording paper [p0052 - Generic Scope Guard and RAII Wrapper for the Standard Library](https://wg21.link/p0052)
24
+
- TS adoption paper [p1411 - Please reconsider <scope> for C++20](https://wg21.link/p1411)
25
+
-[N3677 A Proposal to Add additional RAII Wrappers to the Standard Library](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3677.html)
-[Peter Sommerlad - Woes of Scope Guards and Unique_Resource - 5+ years in the making](https://www.youtube.com/watch?v=O1sK__G5Nrg)
43
+
-[Andrei Alexandrescu - Declarative Control Flow](https://www.youtube.com/watch?v=WjTrfoiB0MQ)
44
+
45
+
# Examples
46
+
47
+
-[TS example of scope_exit](https://godbolt.org/z/T5KhTYjP7)
48
+
49
+
---
50
+
51
+
`beman.scope` is a C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md).
52
+
53
+
**Implements**: TODO
16
54
17
55
**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)
18
56
19
57
## Usage
20
58
21
-
`std::identity` is a function object type whose `operator()` returns its argument unchanged.
22
-
`std::identity` serves as the default projection in constrained algorithms.
23
-
Its direct usage is usually not needed.
59
+
TODO
24
60
25
61
### Example Usage
26
62
@@ -31,7 +67,6 @@ Full runnable examples can be found in `examples/`.
31
67
## Building beman.scope
32
68
33
69
### Dependencies
34
-
<!-- TODO Darius: rewrite section!-->
35
70
36
71
This project has no C or C++ dependencies.
37
72
@@ -84,9 +119,7 @@ apt-get install \
84
119
85
120
### How to build beman.scope
86
121
87
-
This project strives to be as normal and simple a CMake project as possible.
88
-
This build workflow in particular will work,
89
-
producing a static `libbeman.scope.a` library, ready to package with its headers:
0 commit comments