static_assert(util::shares_layout<Box<_Complexdouble>,_Complexdouble*>,"Invalid Box<T> memory layout: More than just T*");
static_assert(util::shares_layout<Box<_Complexdouble>,std::unique_ptr<_Complexdouble>>,"Invalid Box<T> memory layout: More than just std::unique_ptr<T>");
}//TODO: Overload for `const&` that does the type check *before* the copy allocation.
#if 0
template<typenameT,typenameR/*XXX: Maybe remove this, and put the requires after the definition, using `auto&& value` instead of `R&& value`*/>requires(std::derived_from<R,T>)
constexprvirtualtypes::MaybeOwned<Report>into_report()noexcept{/* TODO */}//TODO: Maybe just use `std::optional<std::reference_wrapper<Error>>`? Or Box<Report&>?
constexprvirtualtypes::MaybeOwned<Report>into_report()&noexcept{/* TODO */}//TODO: Maybe just use `std::optional<std::reference_wrapper<Error>>`? Or Box<Report&>?
{returntyped::Box<TracedError>{std::move(*this)};}//TODO: use `boxed::is_boxed_value()` to check if *this is boxed... Uhh, actually... XXX: No that doesn't work, since `Box<T>` doesn't make `T` visible to `boxed::ObjectBase`.... Eh...
// Throws NullDerefException<?> for first type of `ptr` that is null (if any are).
// If: `All == true`: Instead will always throw `NullDerefException<T...> (all types) if any are, and will not assume every pointer is likely to be non-null.
/// Deducable version of `is_empty_pack<typename...>()`
///
/// Can be used as `is_empty_pack(pack...)` instead of the slightly more ugly `is_empty_pack<decltype(pack)...>()` though with (very unlikely, but possible) implications of actually "evaluating" the pack (despite the values themselves are `const&` and never used, they're still passed.)
/// HOWEVER: The latter should likely be preferred, since this function takes possible-nonconstexpr types as arguments, it cannot be immediate like the non-argument taking overload. See below comment for more information on that.
template<typename...A>
[[gnu::const]]//TODO: XXX: This mostly useless function won't mess up overload resolution for `is_empty_pack<types...>()`, right? If it will, either find a way to make sure it comes LAST, or remove it, it's not worth the hassle just so users (i.e. me) can avoid typeing `decltype` for once in my fuckin life... what a stupud keyword name srsl (see static_assert() below.)
andis_empty_pack<>()//XXX: This might also be ambiguous between the type and value one... Eh.... That's actually useful though, so removing this explicit (and pointless) *usage* of the function from the test would be fine if they don't clash in other ways too.
static_cast<void(std::string_view&&)>(throw_runtime)({std::move(msg)});//XXX: We may have to rename the above function (and make it [[internal]], or refactor to make it a private method of a function-object class `throw_runtime` to avoid ambiguations when constexpr-context calls it with the exact typed argument `std::string_view&&`... Maybe... I'm not really sure.
throw_runtime(std::move(view));
}
__builtin_unreachable();
}
// Returns an anonymous union with inavtive field: `T value` and active field `assume init` (no unique address).