43 using value_type = std::exception_ptr;
44 using iterator =
const value_type*;
45 using reverse_iterator = std::reverse_iterator<iterator>;
47 [[nodiscard]] ES_API(CPPESSENCE) iterator begin()
const noexcept;
48 [[nodiscard]] ES_API(CPPESSENCE) iterator end()
const noexcept;
49 [[nodiscard]] ES_API(CPPESSENCE) reverse_iterator rbegin()
const noexcept;
50 [[nodiscard]] ES_API(CPPESSENCE) reverse_iterator rend()
const noexcept;
51 [[nodiscard]] ES_API(CPPESSENCE)
bool empty()
const noexcept;
52 [[nodiscard]] ES_API(CPPESSENCE) std::size_t size()
const noexcept;
53 [[noreturn]] ES_API(CPPESSENCE)
static void flatten_and_throw(
54 const std::exception_ptr& root, std::int32_t indent = default_nested_exception_indent);
56 template <
typename E,
bool Reverse = false>
57 std::optional<E> extract()
const {
59 if constexpr (Reverse) {
65 auto iter_end = [
this] {
66 if constexpr (Reverse) {
73 for (; iter != iter_end; ++iter) {
75 std::rethrow_exception(*iter);
76 }
catch (
const std::exception& ex) {
77 if (
auto concrete =
dynamic_cast<const E*
>(&ex)) {
87 aggregate_error(abi::vector<value_type>&& exceptions, std::string_view what);
89 abi::vector<value_type> exceptions_;