2
0
mirror of https://github.com/boostorg/scope.git synced 2026-02-02 09:02:17 +00:00
Commit Graph

84 Commits

Author SHA1 Message Date
Andrey Semashev
ecb01f0f1c Added a comment describing is_not_like. 2023-12-01 17:46:05 +03:00
Andrey Semashev
28969ef48a Improved wording of scope_success/fail description. 2023-11-30 19:58:01 +03:00
Andrey Semashev
75e353281a Minor update to a scope_fail example. 2023-11-30 18:56:39 +03:00
Andrey Semashev
d9700c5d96 Added a link to P0052R10 in the docs. 2023-11-28 20:43:01 +03:00
Andrey Semashev
fb6607c097 Removed CMake self-test. Added running tests through CMake in GHA CI.
Running tests via CMake should be enough of a verification that the
library CMakeLists.txt is correct. It also verifies that test/CMakeLists.txt
is correct.
2023-11-28 20:20:05 +03:00
Andrey Semashev
be2d47e156 Added C++ features required for tests in CMakeLists.txt. 2023-11-28 20:07:02 +03:00
Andrey Semashev
4c1cd661f7 Merge pull request #8 from pdimov/feature/test-cml
Add test/CMakeLists.txt
2023-11-28 19:59:21 +03:00
Andrey Semashev
5a0f2bc43c Added required C++ features to CMakeLists.txt. 2023-11-28 19:01:01 +03:00
Peter Dimov
b64c5bfc49 Add test/CMakeLists.txt 2023-11-28 16:47:00 +02:00
Andrey Semashev
46cd547bb4 Switched noexcept conditions checking the deleter to use is_nothrow_invocable.
Also hidden these conditions from docs since they now involve symbols
from namespace detail.

Added test for noexcept(reset()).

Closes https://github.com/Lastique/scope/issues/7.
2023-11-28 15:08:02 +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
c9725c4577 Changed unique resource deduction guide to use decay semantics.
This reflects the decay type trait that is used in make_unique_resource_checked
and is needed to support references to functions for deleters.

Added tests for unique_resource type deductions involving references
to functions.
2023-11-28 14:18:09 +03:00
Andrey Semashev
579d953712 Removed scope guard deduction guides for move constructors.
The implicitly added copy deduction guide works in their stead.
2023-11-28 13:51:25 +03:00
Andrey Semashev
052b3b156a Fixed scope guard function type deduction for function references.
Scope guard factory functions used to generate scope guards with incorrect
action and condition types if the factory was called with function
references. The scope guard template arguments used to be function types
instead of references to functions.

Also, deduction guides used to decay the arguments, which would produce
scope guards with pointers to functions in template arguments. Although
this worked, formally only references to functions are supported. So
changed the deduction guides to produce references to functions.

Updated docs and tests.

Fixes https://github.com/Lastique/scope/issues/6.
2023-11-28 01:38:35 +03:00
Andrey Semashev
04f61ef8c8 Corrected a comment. 2023-11-27 00:46:36 +03:00
Andrey Semashev
660ae7245f Corrected a comment. 2023-11-26 19:30:36 +03:00
Andrey Semashev
87726d3d34 Switch clang-12 through 15 to libstdc++11. boost-review-2023-11-26 2023-11-05 20:32:25 +03:00
Andrey Semashev
dadc5bbb00 Merge pull request #4 from grisumbras/vcpkg-port
Vcpkg port
2023-11-05 19:58:51 +03:00
Andrey Semashev
457900829d Merge branch 'develop' into vcpkg-port 2023-11-05 19:58:36 +03:00
Andrey Semashev
9085803ad1 Merge pull request #3 from grisumbras/conan-recipe
Added Conan recipe
2023-11-05 19:57:22 +03:00
Dmitry Arkhipov
63c735d5a9 Added vcpkg port 2023-11-05 19:52:39 +03:00
Dmitry Arkhipov
665a6ed059 Added Conan recipe 2023-11-05 19:45:45 +03:00
Andrey Semashev
6c14f5ccbd Simplified compact_storage implementation. 2023-10-16 02:34:18 +03:00
Andrey Semashev
600ba564cb Nonessential code formatting. 2023-10-16 02:24:00 +03:00
Andrey Semashev
ae4fdba5b0 Added CI jobs for clang-17. 2023-10-15 03:37:08 +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
fa83932e51 Separated fd_deleter and fd_resource_traits into different headers. 2023-10-14 19:33:53 +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
f44ada4ab8 Switch to boost::core::invoke_swap.
boost::swap is deprecated and will be removed. Use boost::core::invoke_swap
as a replacement.
2023-09-03 04:08:35 +03:00
Andrey Semashev
d4f8e6b62b Add clang-16 CI jobs, switch to clang-15 from stock Ubuntu repos. 2023-06-05 03:23:35 +03:00
Andrey Semashev
f3ea39eeb7 Assert the expected uncaught_exceptions() result in exception_checker.
This may help detect unsupported uses of exception_checker with coroutines
and non-scoped scope guards.

Closes https://github.com/Lastique/scope/issues/2.
2023-04-24 00:38:47 +03:00
Andrey Semashev
ee3af04981 Renamed user's object method in the docs.
This avoids a potential confusion that the object in the examples
is a scope guard, as scope guards have the set_active method.

Closes https://github.com/Lastique/scope/issues/1.
2023-04-15 19:47:45 +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
a4a5a8443a Added docs for template parameters. 2023-04-09 01:03:23 +03:00
Andrey Semashev
0dd24702fa Fixed missing default args in Doxygen docs. 2023-04-09 00:57:35 +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
c242b2b82b Mention in readme that this library is proposed for Boost. 2023-03-28 12:56:27 +03:00
Andrey Semashev
9d4e70a877 Added docs for scope_check and scope guard conditions. 2023-03-27 04:18:31 +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
5a8148562f Removed name imports into boost namespace. 2023-03-22 03:57:17 +03:00
Andrey Semashev
097877d14a Added a link to the docs to readme. 2023-03-22 03:53:44 +03:00
Andrey Semashev
7a614f7129 Added redirect page. 2023-03-22 03:48:11 +03:00
Andrey Semashev
bb538c366c Working on unique_resource docs. 2023-03-22 03:23:56 +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
aa04610b4b Added self-contained header tests on Windows. 2023-03-20 01:55:27 +03:00
Andrey Semashev
95620761c9 Working on unique_resource docs. 2023-03-20 01:51:56 +03:00
Andrey Semashev
0e83fcbde7 Added support for file descriptors on Windows. 2023-03-20 00:21:06 +03:00
Andrey Semashev
04fec628ef Updating docs for unique_resource. 2023-03-12 20:56:55 +03:00