Skip to content

Commit

Permalink
fixed bug in dynamic_allocator::empty
Browse files Browse the repository at this point in the history
  • Loading branch information
zajo committed Dec 13, 2023
1 parent c95f803 commit f8cd54d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions include/boost/leaf/detail/capture_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ namespace leaf_detail
}
}

BOOST_LEAF_CONSTEXPR bool empty() const noexcept
{
return first_ == nullptr;
}

void unload( int const err_id )
{
capture_list moved(first_);
Expand Down
7 changes: 1 addition & 6 deletions include/boost/leaf/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,6 @@ namespace leaf_detail
} );
}

bool empty() const noexcept
{
BOOST_LEAF_ASSERT(first_ != nullptr || last_ == &first_);
return first_ != nullptr;
}

int size() const noexcept
{
int c = 0;
Expand All @@ -392,6 +386,7 @@ namespace leaf_detail
return { err_id_, capture_list(f) };
}

using capture_list::empty;
using capture_list::unload;
using capture_list::print;
};
Expand Down

0 comments on commit f8cd54d

Please sign in to comment.