mirror of
https://github.com/TartanLlama/expected.git
synced 2025-08-02 18:34:29 +02:00
Fixed missing decay in make_unexpected (ex: const lvalue expressions would create unexpected<T const&>, which would not compile)
This commit is contained in:
@@ -158,8 +158,8 @@ constexpr bool operator>=(const unexpected<E> &lhs, const unexpected<E> &rhs) {
|
||||
/// *Example:*
|
||||
/// auto e1 = tl::make_unexpected(42);
|
||||
/// unexpected<int> e2 (42); //same semantics
|
||||
template <class E> unexpected<E> make_unexpected(E &&e) {
|
||||
return unexpected<E>(std::forward<E>(e));
|
||||
template <class E> unexpected<typename std::decay<E>::type> make_unexpected(E &&e) {
|
||||
return unexpected<typename std::decay<E>::type>(std::forward<E>(e));
|
||||
}
|
||||
|
||||
/// \brief A tag type to tell expected to construct the unexpected value
|
||||
|
Reference in New Issue
Block a user