Closed Forlautboy closed 2 months ago
It seems that for C++17 it cannot implicitly convert from int
to Test
with the etl/std::forward
in the function etl/std::construct_at
. This seems to have been fixed in C++20.
The only way around this is to add a constructor to Test
.
We encountered a situation where using etl::optional::emplace with a object with a const member leeds to the following compiler error:
"error: non-static const member 'const int Test::m_i', cannot use default assignment operator"
The following link provides a minimal Example: https://godbolt.org/z/bYEEYvKqM
It seams like etl::optional::emplace implements special case where assignement ist executed instead of emplacement. Whats also interesting is, that the standard-library posesses simular behaviour with C++17.