in src/iceberg/expected.h [1348:1382]
if constexpr (std::is_nothrow_move_constructible_v<E>) {
E tmp(std::move(rhs.error()));
if constexpr (!std::is_trivially_destructible_v<E>) {
rhs.error().~E();
}
if constexpr (std::is_nothrow_move_constructible_v<T>) {
std::construct_at(std::addressof(rhs.m_val), std::move(this->m_val));
} else {
expected_detail::ReinitGuard<E> guard{std::addressof(rhs.error()),
std::addressof(tmp)};
std::construct_at(std::addressof(rhs.m_val), std::move(this->m_val));
guard._target = nullptr;
}
if constexpr (!std::is_trivially_destructible_v<T>) {
this->m_val.~T();
}
std::construct_at(std::addressof(this->error()), std::move(tmp));
} else {
T tmp(std::move(this->m_val));
if constexpr (!std::is_trivially_destructible_v<T>) {
this->m_val.~T();
}
expected_detail::ReinitGuard<T> guard{std::addressof(this->m_val),
std::addressof(tmp)};
std::construct_at(std::addressof(this->error()), std::move(rhs.error()));
guard._target = nullptr;
if constexpr (!std::is_trivially_destructible_v<E>) {
rhs.error().~E();
}
std::construct_at(std::addressof(rhs.m_val), std::move(tmp));
}