2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-27 19:32:07 +00:00
Commit Graph

16 Commits

Author SHA1 Message Date
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
c5635f21cc Implemented scope_check and added support for arbitrary fail conditions.
The new scope_check scope guard is a generalization of scope_success and
scope_fail and allows specifying arbitrary conditions for executing the
scope exit action. The scope_success and scope_fail have been
reimplemented in terms of scope_check and now also support arbitrary
fail conditions.

Added exception_checker and error_code_checker conditions for testing
for an exception being thrown and for an error code, respectively.
scope_success and scope_fail use exception_checker by default.

Added tests for the new components.
2023-03-26 21:02:11 +03:00
Andrey Semashev
4f00244b8e Also disable MSVC aborts in release mode. 2023-03-20 03:53:30 +03:00
Andrey Semashev
f4c70e1523 Suppress assertion failure aborts with MSVC. 2023-03-20 03:23:36 +03:00
Andrey Semashev
0e83fcbde7 Added support for file descriptors on Windows. 2023-03-20 00:21:06 +03:00
Andrey Semashev
6c2649c12e Added tests for preventing construction of reference resource wrappers from rvalues. 2023-03-06 04:49:52 +03:00
Andrey Semashev
f3cfd937f6 Updated license headers. 2023-02-24 19:30:55 +03:00
Andrey Semashev
18b135804a Added support for default_resource keyword. 2023-02-22 01:38:35 +03:00
Andrey Semashev
f12546687e Added checks for whether the function object is destroyed after throwing. 2023-02-21 02:35:23 +03:00
Andrey Semashev
678253f727 Added more tests for exception handling, fixed bugs. 2023-02-21 02:27:42 +03:00
Andrey Semashev
43819ad703 Added more tests for exception handling. 2023-02-20 03:27:43 +03:00
Andrey Semashev
5abe4610ea Use test executable file in unique_posix_fd test.
Opening /dev/null may fail on Cygwin and possibly other systems
where it doesn't exist.
2023-02-18 14:59:02 +03:00
Andrey Semashev
6f3272d538 Added a CMake self-test. 2023-02-13 01:46:59 +03:00
Andrey Semashev
928160b613 Added unique_posix_fd. Fixed unique_resource traits support. Added tests. 2023-02-12 20:13:53 +03:00
Andrey Semashev
166d6a178b Fixes and tests for unique_resource. 2023-01-24 02:22:16 +03:00
Andrey Semashev
9f55473af2 Initial commit. 2023-01-10 02:18:35 +03:00