./expected.hpp:869:67: error: exception specification of 'swap' uses itself
std::is_nothrow_move_constructible<E>::value && noexcept( swap( std::declval<E&>(), std::declv...
^
./expected.hpp:869:67: note: in instantiation of exception specification for 'swap' requested here
./expected.hpp:842:25: note: in instantiation of exception specification for 'swap' requested here
expected( rhs ).swap( *this );
^
main.cpp:6:6: note: in instantiation of member function 'nonstd::expected<void,
std::__1::error_code>::operator=' requested here
e2 = e1;
^
In file included from main.cpp:1:
./expected.hpp:869:93: error: too many arguments to function call, expected single argument 'rhs', have 2
arguments
...&& noexcept( swap( std::declval<E&>(), std::declval<E&>() ) )
~~~~ ^~~~~~~~~~~~~~~~~~
./expected.hpp:867:5: note: 'swap' declared here
void swap( expected & rhs ) noexcept
This code won't compile with clang:
It gives the error message: