foobar
const
void foobar(const int&) { } // not called template<typename U> void foobar(U&&) { } // called int main() { int i = 159; foobar(i); return 0; }
std::optional<T>
template < class U = T > constexpr optional( U&& value );
Quote:This constructor does not participate in overload resolution unless std::is_constructible_v<t, u&&=""> is true and std::decay_t (until C++20)std::remove_cvref_t (since C++20) is neither std::in_place_t nor std::optional<t>.
Quote:"... is neither ... nor std::optional<t>."
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)