File tree Expand file tree Collapse file tree 2 files changed +1
-21
lines changed
koladata/functor/parallel Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Original file line number Diff line number Diff line change 1717
1818#include < cstddef>
1919#include < memory>
20- #include < utility>
2120
2221#include " absl/log/check.h"
2322
@@ -28,11 +27,6 @@ class ContextGuard final {
2827 public:
2928 ContextGuard () = default ;
3029
31- template <typename T, typename ... Args>
32- explicit ContextGuard (std::in_place_type_t <T>, Args&&... args) {
33- init<T>(std::forward<Args>(args)...);
34- }
35-
3630 ~ContextGuard () {
3731 if (destructor_fn_ != nullptr ) {
3832 destructor_fn_ (buffer_);
Original file line number Diff line number Diff line change @@ -38,21 +38,7 @@ class TestScopeGuard {
3838 std::function<void ()> on_destruct_fn_;
3939};
4040
41- TEST (ContextGuardTest, TestScopeGuardInplaceCtor) {
42- bool constructed = false ;
43- bool destructed = false ;
44- std::function<void ()> on_construct = [&] { constructed = true ; };
45- std::function<void ()> on_destruct = [&] { destructed = true ; };
46- {
47- ContextGuard context_guard (std::in_place_type_t <TestScopeGuard>(),
48- on_construct, on_destruct);
49- EXPECT_TRUE (constructed);
50- EXPECT_FALSE (destructed);
51- }
52- EXPECT_TRUE (destructed);
53- }
54-
55- TEST (ContextGuardTest, TestScopeGuardInit) {
41+ TEST (ContextGuardTest, TestScopeGuard) {
5642 bool constructed = false ;
5743 bool destructed = false ;
5844 std::function<void ()> on_construct = [&] { constructed = true ; };
You can’t perform that action at this time.
0 commit comments