From f8cd54d9a3964cb3f6fe4c6bcac7459905e43520 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 12 Dec 2023 22:42:37 -0800 Subject: [PATCH] fixed bug in dynamic_allocator::empty --- include/boost/leaf/detail/capture_list.hpp | 5 +++++ include/boost/leaf/error.hpp | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/leaf/detail/capture_list.hpp b/include/boost/leaf/detail/capture_list.hpp index 491415a8..e2401b00 100644 --- a/include/boost/leaf/detail/capture_list.hpp +++ b/include/boost/leaf/detail/capture_list.hpp @@ -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_); diff --git a/include/boost/leaf/error.hpp b/include/boost/leaf/error.hpp index b77b68c1..00f60904 100644 --- a/include/boost/leaf/error.hpp +++ b/include/boost/leaf/error.hpp @@ -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; @@ -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; };