Swap can be part of the etl namespace and let ADL do its thing (#1414)

* Print test names at test time (#1343)

* Fix operator| conflict with std::ranges (#1395)

* Swap can be part of the etl namespace and let ADL do its thing

---------

Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
This commit is contained in:
Joris Putcuyps 2026-04-28 10:23:52 +02:00 committed by GitHub
parent ff772d4bd1
commit 5ccbc6fbff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1380,24 +1380,25 @@ namespace etl
{
return !(lhs == rhs);
}
//*******************************************
/// Swap etl::expected.
//*******************************************
template <typename TValue, typename TError>
ETL_CONSTEXPR14 void swap(etl::expected<TValue, TError>& lhs, etl::expected<TValue, TError>& rhs)
{
lhs.swap(rhs);
}
//*******************************************
/// Swap etl::unexpected.
//*******************************************
template <typename TError>
ETL_CONSTEXPR14 void swap(etl::unexpected<TError>& lhs, etl::unexpected<TError>& rhs)
{
lhs.swap(rhs);
}
} // namespace etl
//*******************************************
/// Swap etl::expected.
//*******************************************
template <typename TValue, typename TError>
ETL_CONSTEXPR14 void swap(etl::expected<TValue, TError>& lhs, etl::expected<TValue, TError>& rhs)
{
lhs.swap(rhs);
}
//*******************************************
/// Swap etl::unexpected.
//*******************************************
template <typename TError>
ETL_CONSTEXPR14 void swap(etl::unexpected<TError>& lhs, etl::unexpected<TError>& rhs)
{
lhs.swap(rhs);
}
#endif