Fixed issue #129 (#131)

+ Fixed unused variable warning
+ Added a `std::move` to avoid calling copy-assignment operator on non-copyable types

Co-authored-by: andy-byers <andrew.byers@utdallas.edu>
This commit is contained in:
Andrew Byers
2023-02-15 15:54:16 +00:00
committed by GitHub
co-authored by andy-byers
parent 79a2068c9a
commit f5e6e9aeed
3 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -208,6 +208,7 @@ template <typename E>
#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
throw std::forward<E>(e);
#else
(void)e;
#ifdef _MSC_VER
__assume(0);
#else
@@ -824,7 +825,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
geterr().~unexpected<E>();
construct(std::move(rhs).get());
} else {
assign_common(rhs);
assign_common(std::move(rhs));
}
}