File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1818import std;
1919import beman.scope;
2020
21+ // clang-format off
2122struct noisy_resource {
22- noisy_resource () { std::print (" construct noisy\n " ); }
23- ~noisy_resource () { std::print (" destroy noisy\n " ); }
23+ noisy_resource () { std::print ( " construct noisy\n " ); }
24+ ~noisy_resource () { std::print ( " destroy noisy\n " ); }
2425};
2526
2627int main () {
2728
2829 bool exit_ran, success_ran, fail_ran = false ;
2930 {
3031 std::print (" --> scope start\n " );
31- beman::scope::scope_exit _ ([&exit_ran] { exit_ran = true ; });
32+ beman::scope::scope_exit _ ([&exit_ran] { exit_ran = true ; });
3233 beman::scope::scope_success _ ([&success_ran] { success_ran = true ; });
33- beman::scope::scope_fail _ ([&fail_ran] { fail_ran = true ; });
34+ beman::scope::scope_fail _ ([&fail_ran] { fail_ran = true ; });
3435 auto resource_ptr = beman::scope::unique_resource (new noisy_resource (),
3536 // Cleanup function
3637 [](noisy_resource* ptr) { delete ptr; });
You can’t perform that action at this time.
0 commit comments