From 18907410797f3db44fa10fcf6a4a7be96f1288e3 Mon Sep 17 00:00:00 2001 From: Kern Handa Date: Wed, 23 Sep 2015 23:04:12 -0700 Subject: [PATCH] Change finally() to make_final_act() --- include/gsl.h | 4 ++-- tests/utils_tests.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/gsl.h b/include/gsl.h index cf6eca5..8715129 100644 --- a/include/gsl.h +++ b/include/gsl.h @@ -59,9 +59,9 @@ private: F f_; }; -// finally() - convenience function to generate a Final_act +// make_final_act() - convenience function to generate a Final_act template -Final_act finally(F f) { return Final_act(f); } +Final_act make_final_act(F f) { return Final_act(f); } // narrow_cast(): a searchable way to do narrowing casts of values template diff --git a/tests/utils_tests.cpp b/tests/utils_tests.cpp index 0dc4809..bdc07d9 100644 --- a/tests/utils_tests.cpp +++ b/tests/utils_tests.cpp @@ -27,21 +27,21 @@ SUITE(utils_tests) i += 1; } - TEST(finally_lambda) + TEST(make_final_act_lambda) { int i = 0; { - auto _ = finally([&]() {f(i);}); + auto _ = make_final_act([&]() {f(i);}); CHECK(i == 0); } CHECK(i == 1); } - TEST(finally_function_with_bind) + TEST(make_final_act_function_with_bind) { int i = 0; { - auto _ = finally(std::bind(&f, std::ref(i))); + auto _ = make_final_act(std::bind(&f, std::ref(i))); CHECK(i == 0); } CHECK(i == 1); @@ -49,11 +49,11 @@ SUITE(utils_tests) int j = 0; void g() { j += 1; }; - TEST(finally_function_ptr) + TEST(make_final_act_function_ptr) { j = 0; { - auto _ = finally(&g); + auto _ = make_final_act(&g); CHECK(j == 0); } CHECK(j == 1);