Fix ODR violation in optional (#1522)

* Fix ODR violation in optional

Detected by GCC 15, when using in a module context.

* Make etl::nullopt constant
This commit is contained in:
Björn Schäpers 2026-07-26 10:21:53 +02:00 committed by GitHub
parent c1cab856a8
commit 52502734fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,7 +59,7 @@ namespace etl
// Convertible to any type of null non-member pointer.
template <class T>
operator T*() const
ETL_CONSTEXPR operator T*() const ETL_NOEXCEPT
{
return 0;
}
@ -74,7 +74,7 @@ namespace etl
/// A null option.
///\ingroup utilities
//*****************************************************************************
const nullopt_t nullopt = {};
ETL_INLINE_VAR ETL_CONSTANT nullopt_t nullopt = {};
//***************************************************************************
/// Exception for optional.