2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-24 06:22:08 +00:00

28 Commits

Author SHA1 Message Date
Andrey Semashev
c1a41db7a6 Wording improvement in the docs. 2025-05-13 01:18:07 +03:00
Andrey Semashev
db963eab9c Fixed an example of using scope_exit with std::function in the docs.
Closes https://github.com/boostorg/scope/issues/20.
2024-07-03 23:17:20 +03:00
Andrey Semashev
db29667f84 Improved scope guard docs. 2024-02-07 13:52:25 +03:00
Andrey Semashev
adf827b190 Docs improvements.
Removed Boost.ScopeExit from the table on the front page. Comparison with
Boost.ScopeExit is in a separate section, so this table duplicated it
to some degree and detracted focus from introducing Boost.Scope.

Added an example with unique_resource to the front page.

Other wording and example improvements.
2024-02-03 21:08:05 +03:00
Andrey Semashev
05bf32daa5 Added an example of using set_active with a runtime value. 2024-02-02 02:42:17 +03:00
Andrey Semashev
f781fd71c7 Improved scope guard examples in docs. 2024-02-01 02:52:09 +03:00
Andrey Semashev
080e8100f1 Made formatting more consistent in examples. 2024-01-30 11:43:59 +03:00
Andrey Semashev
10d22551b2 Moved caveats of capturing by reference to a separate section. 2024-01-28 04:36:52 +03:00
Andrey Semashev
56afb11dbd Added an example showing scope_exit/scope_success/scope_fail usage. 2024-01-28 04:11:45 +03:00
Andrey Semashev
ecb7d7c9cd Added comparison with Library Fundamentals TS components in the docs.
Closes https://github.com/Lastique/scope/issues/5.
2024-01-27 20:35:54 +03:00
Andrey Semashev
b0117a4b2e Renamed scope_final to defer_guard and BOOST_SCOPE_FINAL to BOOST_SCOPE_DEFER.
This follows the suggestion by Peter Dimov during the review.
2024-01-19 01:13:26 +03:00
Andrey Semashev
ad4005f87e Added an assert to make it obvious that ptr is not null. 2023-12-03 01:16:37 +03:00
Andrey Semashev
7ee1b44711 Added a note about potential issues of capturing by reference in scope guards. 2023-12-03 01:11:01 +03:00
Andrey Semashev
5719cd4966 Changed the wording to discourage using std::function with scope guards. 2023-12-02 23:39:39 +03:00
Andrey Semashev
f081d0f850 Improved wording leading to function object type requirements.
Closes https://github.com/Lastique/scope/issues/12.
2023-12-02 19:50:33 +03:00
Andrey Semashev
75e353281a Minor update to a scope_fail example. 2023-11-30 18:56:39 +03:00
Andrey Semashev
016a3a3820 Decay references to functions to pointers in scope guards CTAD.
Apparently, the Library Fundamentals TS does permit pointers to functions
in scope guards (via the "function object type" definition in the standard),
so instead of taking the effort to preserve the function references decay
those to pointers to functions.

Updated docs and tests.
2023-11-28 14:50:12 +03:00
Andrey Semashev
e964176389 Improved table formaitting. 2023-10-15 03:26:21 +03:00
Andrey Semashev
9778a1d3ea Added a separate section with comparison with Boost.ScopeExit 2023-10-15 00:44:27 +03:00
Andrey Semashev
fbfdb8a494 Merged scope_check into scope_exit.
As suggested by Peter Dimov on boost-dev ML, scope_check functionality
is merged into scope_exit. Thus scope_exit now has an optional condition
function object, which by default always returns true. If a custom
function object is specified, scope_exit works equivalently to the
previous scope_check, i.e. calls the condition function object to check
whether the action function object needs to be called.
2023-10-14 19:23:32 +03:00
Andrey Semashev
45fe19acf4 Added discussion of scope_fail vs. scope_exit in the docs. 2023-04-15 00:22:56 +03:00
Andrey Semashev
c9434eaee8 Updated docs to discuss issues with checking for a thrown exception.
Based on the boost-dev ML discussion, added a note regarding exception_checker
limitation with coroutines. Also, rearranged docs and improved wording in
a few places to make exception_checker and condition functions in general
documentation more distinct. Added rationale for using conditional scope guards
as opposed to using scope_exit universally.
2023-04-09 00:30:36 +03:00
Andrey Semashev
9d4e70a877 Added docs for scope_check and scope guard conditions. 2023-03-27 04:18:31 +03:00
Andrey Semashev
04fec628ef Updating docs for unique_resource. 2023-03-12 20:56:55 +03:00
Andrey Semashev
640e16c317 Updated the note about movability of scope guards. 2023-03-12 17:50:36 +03:00
Andrey Semashev
299cc5dce6 Added a note about moved-from scope guard being active on destruction. 2023-03-12 01:01:02 +03:00
Andrey Semashev
622b434272 Added highlighting features of BOOST_SCOPE_FINAL. 2023-03-12 00:52:42 +03:00
Andrey Semashev
e0fc6d6626 Added scope guards docs. 2023-03-12 00:43:47 +03:00