File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change @@ -86,34 +86,6 @@ class linked_bump_allocator : public boost::container::pmr::memory_resource {
8686 rewind_state rewind_;
8787 };
8888
89- // Calls allocator->rewind() when destructed iff rewind_on_destruct() was
90- // called.
91- class conditional_rewind_guard {
92- public:
93- explicit conditional_rewind_guard (linked_bump_allocator* allocator)
94- : allocator_(allocator), rewind_(allocator->prepare_for_rewind ()) {}
95-
96- conditional_rewind_guard (const conditional_rewind_guard&) = delete;
97- conditional_rewind_guard& operator =(const conditional_rewind_guard&) =
98- delete;
99-
100- conditional_rewind_guard (conditional_rewind_guard&&) = delete ;
101- conditional_rewind_guard& operator =(conditional_rewind_guard&&) = delete ;
102-
103- ~conditional_rewind_guard () {
104- if (this ->should_rewind_ ) {
105- this ->allocator_ ->rewind (std::move (this ->rewind_ ));
106- }
107- }
108-
109- void rewind_on_destruct () { this ->should_rewind_ = true ; }
110-
111- private:
112- linked_bump_allocator* allocator_;
113- rewind_state rewind_;
114- bool should_rewind_ = false ;
115- };
116-
11789 rewind_state prepare_for_rewind () {
11890 return rewind_state{
11991 .chunk_ = this ->chunk_ ,
You can’t perform that action at this time.
0 commit comments