Skip to content

Commit a932580

Browse files
committed
run clang-format on new source
1 parent 00ef6eb commit a932580

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

examples/scope-module.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,29 @@
1313
// construct noisy
1414
// --> scope end
1515
// destroy noisy
16-
// scope exit: true success: true fail: false
16+
// scope exit: true success: true fail: false
1717

1818
import std;
1919
import beman.scope;
2020

21-
struct noisy_resource
22-
{
23-
noisy_resource() { std::print("construct noisy\n"); }
24-
~noisy_resource() { std::print("destroy noisy\n"); }
21+
struct noisy_resource {
22+
noisy_resource() { std::print("construct noisy\n"); }
23+
~noisy_resource() { std::print("destroy noisy\n"); }
2524
};
2625

27-
int main()
28-
{
26+
int main() {
2927

30-
bool exit_ran, success_ran, fail_ran = false;
31-
{
32-
std::print( "--> scope start\n" );
33-
beman::scope::scope_exit _([&exit_ran] { exit_ran = true; });
34-
beman::scope::scope_success _([&success_ran]{ success_ran = true;});
35-
beman::scope::scope_fail _([&fail_ran] { fail_ran = true; });
36-
auto resource_ptr = beman::scope::unique_resource
37-
(
38-
new noisy_resource(),
39-
// Cleanup function
40-
[](noisy_resource* ptr) { delete ptr; }
41-
);
42-
std::print( "--> scope end\n");
43-
} // Normal scope exit
28+
bool exit_ran, success_ran, fail_ran = false;
29+
{
30+
std::print("--> scope start\n");
31+
beman::scope::scope_exit _([&exit_ran] { exit_ran = true; });
32+
beman::scope::scope_success _([&success_ran] { success_ran = true; });
33+
beman::scope::scope_fail _([&fail_ran] { fail_ran = true; });
34+
auto resource_ptr = beman::scope::unique_resource(new noisy_resource(),
35+
// Cleanup function
36+
[](noisy_resource* ptr) { delete ptr; });
37+
std::print("--> scope end\n");
38+
} // Normal scope exit
4439

45-
std::print("scope exit: {} success: {} fail: {} \n",
46-
exit_ran, success_ran, fail_ran);
40+
std::print("scope exit: {} success: {} fail: {} \n", exit_ran, success_ran, fail_ran);
4741
}

include/beman/scope/beman.scope.cppm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module;
88
export module beman.scope;
99

1010
export namespace beman::scope {
11-
using ::beman::scope::scope_exit;
12-
using ::beman::scope::scope_fail;
13-
using ::beman::scope::scope_success;
14-
using ::beman::scope::unique_resource;
15-
}
11+
using ::beman::scope::scope_exit;
12+
using ::beman::scope::scope_fail;
13+
using ::beman::scope::scope_success;
14+
using ::beman::scope::unique_resource;
15+
} // namespace beman::scope

0 commit comments

Comments
 (0)