mirror of
https://github.com/TartanLlama/expected.git
synced 2025-08-04 03:14:29 +02:00
Merge pull request #3 from KABoissonneault/unexpected_decay
Fixed missing decay in make_unexpected
This commit is contained in:
@@ -158,8 +158,8 @@ constexpr bool operator>=(const unexpected<E> &lhs, const unexpected<E> &rhs) {
|
|||||||
/// *Example:*
|
/// *Example:*
|
||||||
/// auto e1 = tl::make_unexpected(42);
|
/// auto e1 = tl::make_unexpected(42);
|
||||||
/// unexpected<int> e2 (42); //same semantics
|
/// unexpected<int> e2 (42); //same semantics
|
||||||
template <class E> unexpected<E> make_unexpected(E &&e) {
|
template <class E> unexpected<typename std::decay<E>::type> make_unexpected(E &&e) {
|
||||||
return unexpected<E>(std::forward<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
|
/// \brief A tag type to tell expected to construct the unexpected value
|
||||||
|
Reference in New Issue
Block a user