Skip to content

Commit 95b99e5

Browse files
committed
Fix formatting
1 parent 7bdc7f7 commit 95b99e5

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

include/detail/scope_guard_base.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace sr::detail
6060
public:
6161
template <class EFP,
6262
std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0,
63-
std::enable_if_t<(!std::is_lvalue_reference_v<EFP>) &&std::is_nothrow_constructible_v<EF, EFP>, int> = 0>
63+
std::enable_if_t<(!std::is_lvalue_reference_v<EFP>) && std::is_nothrow_constructible_v<EF, EFP>, int> = 0>
6464
explicit scope_guard_base(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP> || std::is_nothrow_constructible_v<EF, EFP&>)
6565
: exitfunction(std::forward<EFP>(exitFunction)),
6666
execute_on_destruction(true)
@@ -71,8 +71,9 @@ namespace sr::detail
7171
std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0,
7272
std::enable_if_t<std::is_lvalue_reference_v<EFP>, int> = 0>
7373
explicit scope_guard_base(EFP&& exitFunction)
74-
try : exitfunction(exitFunction),
75-
execute_on_destruction(true)
74+
try
75+
: exitfunction(exitFunction),
76+
execute_on_destruction(true)
7677
{
7778
}
7879
catch (...)

include/unique_resource.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ namespace sr
5252
}
5353

5454
template <class RR, class DD,
55-
std::enable_if_t<(std::is_constructible_v<R, RR> && std::is_constructible_v<D, DD> && (std::is_nothrow_constructible_v<R, RR> || std::is_constructible_v<R, RR&>) &&(std::is_nothrow_constructible_v<D, DD> || std::is_constructible_v<D, DD&>) ), int> = 0>
56-
unique_resource(RR&& r, DD&& d) noexcept((std::is_nothrow_constructible_v<R, RR> || std::is_nothrow_constructible_v<R, RR&>) &&(std::is_nothrow_constructible_v<D, DD> || std::is_nothrow_constructible_v<D, DD&>) )
55+
std::enable_if_t<(std::is_constructible_v<R, RR> && std::is_constructible_v<D, DD> && (std::is_nothrow_constructible_v<R, RR> || std::is_constructible_v<R, RR&>) && (std::is_nothrow_constructible_v<D, DD> || std::is_constructible_v<D, DD&>) ), int> = 0>
56+
unique_resource(RR&& r, DD&& d) noexcept((std::is_nothrow_constructible_v<R, RR> || std::is_nothrow_constructible_v<R, RR&>) && (std::is_nothrow_constructible_v<D, DD> || std::is_nothrow_constructible_v<D, DD&>) )
5757
: resource(detail::forward_if_nothrow_constructible<R, RR>(std::forward<RR>(r)), scope_exit{[&r, &d]
5858
{ d(r); }}),
5959
deleter(detail::forward_if_nothrow_constructible<D, DD>(std::forward<DD>(d)), scope_exit{[this, &d]
@@ -62,7 +62,7 @@ namespace sr
6262
{
6363
}
6464

65-
unique_resource(unique_resource&& other) noexcept(std::is_nothrow_move_constructible_v<R>&& std::is_nothrow_move_constructible_v<D>)
65+
unique_resource(unique_resource&& other) noexcept(std::is_nothrow_move_constructible_v<R> && std::is_nothrow_move_constructible_v<D>)
6666
: resource(std::move_if_noexcept(other.resource.get())),
6767
deleter(std::move_if_noexcept(other.deleter.get()), scope_exit{[&other]
6868
{
@@ -144,8 +144,8 @@ namespace sr
144144

145145

146146
template <class RR = R, class DD = D,
147-
std::enable_if_t<(std::is_nothrow_move_assignable_v<RR> || std::is_copy_assignable_v<RR>) &&(std::is_nothrow_move_assignable_v<DD> || std::is_copy_assignable_v<DD>), int> = 0>
148-
unique_resource& operator=(unique_resource&& other) noexcept(std::is_nothrow_assignable_v<R&, R>&& std::is_nothrow_assignable_v<D&, D>)
147+
std::enable_if_t<(std::is_nothrow_move_assignable_v<RR> || std::is_copy_assignable_v<RR>) && (std::is_nothrow_move_assignable_v<DD> || std::is_copy_assignable_v<DD>), int> = 0>
148+
unique_resource& operator=(unique_resource&& other) noexcept(std::is_nothrow_assignable_v<R&, R> && std::is_nothrow_assignable_v<D&, D>)
149149
{
150150
if (this != &other)
151151
{
@@ -198,7 +198,7 @@ namespace sr
198198

199199

200200
template <class R, class D, class S = std::decay_t<R>>
201-
unique_resource<std::decay_t<R>, std::decay_t<D>> make_unique_resource_checked(R&& r, const S& invalid, D&& d) noexcept(std::is_nothrow_constructible_v<std::decay_t<R>, R>&& std::is_nothrow_constructible_v<std::decay_t<D>, D>)
201+
unique_resource<std::decay_t<R>, std::decay_t<D>> make_unique_resource_checked(R&& r, const S& invalid, D&& d) noexcept(std::is_nothrow_constructible_v<std::decay_t<R>, R> && std::is_nothrow_constructible_v<std::decay_t<D>, D>)
202202
{
203203
unique_resource<std::decay_t<R>, std::decay_t<D>> ur{std::forward<R>(r), std::forward<D>(d)};
204204

0 commit comments

Comments
 (0)