mirror of
https://github.com/TartanLlama/expected.git
synced 2025-08-03 19:04:29 +02:00
Fix #32
This commit is contained in:
@@ -68,4 +68,8 @@ struct i31{
|
|||||||
TEST_CASE("Issue 31", "[issues.31]") {
|
TEST_CASE("Issue 31", "[issues.31]") {
|
||||||
const tl::expected<i31, int> a = i31{42};
|
const tl::expected<i31, int> a = i31{42};
|
||||||
a->i;
|
a->i;
|
||||||
|
|
||||||
|
tl::expected< void, std::string > result;
|
||||||
|
tl::expected< void, std::string > result2 = result;
|
||||||
|
result2 = result;
|
||||||
}
|
}
|
||||||
|
@@ -324,6 +324,16 @@ template <class T>
|
|||||||
using is_move_constructible_or_void =
|
using is_move_constructible_or_void =
|
||||||
is_void_or<T, std::is_move_constructible<T>>;
|
is_void_or<T, std::is_move_constructible<T>>;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
using is_copy_assignable_or_void =
|
||||||
|
is_void_or<T, std::is_copy_assignable<T>>;
|
||||||
|
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
using is_move_assignable_or_void =
|
||||||
|
is_void_or<T, std::is_move_assignable<T>>;
|
||||||
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
/// \exclude
|
/// \exclude
|
||||||
@@ -998,13 +1008,13 @@ struct expected_delete_ctor_base<T, E, false, false> {
|
|||||||
// constructors depending on whether T and E are copy/move constructible +
|
// constructors depending on whether T and E are copy/move constructible +
|
||||||
// assignable
|
// assignable
|
||||||
template <class T, class E,
|
template <class T, class E,
|
||||||
bool EnableCopy = (std::is_copy_constructible<T>::value &&
|
bool EnableCopy = (is_copy_constructible_or_void<T>::value &&
|
||||||
std::is_copy_constructible<E>::value &&
|
std::is_copy_constructible<E>::value &&
|
||||||
std::is_copy_assignable<T>::value &&
|
is_copy_assignable_or_void<T>::value &&
|
||||||
std::is_copy_assignable<E>::value),
|
std::is_copy_assignable<E>::value),
|
||||||
bool EnableMove = (std::is_move_constructible<T>::value &&
|
bool EnableMove = (is_move_constructible_or_void<T>::value &&
|
||||||
std::is_move_constructible<E>::value &&
|
std::is_move_constructible<E>::value &&
|
||||||
std::is_move_assignable<T>::value &&
|
is_move_assignable_or_void<T>::value &&
|
||||||
std::is_move_assignable<E>::value)>
|
std::is_move_assignable<E>::value)>
|
||||||
struct expected_delete_assign_base {
|
struct expected_delete_assign_base {
|
||||||
expected_delete_assign_base() = default;
|
expected_delete_assign_base() = default;
|
||||||
|
Reference in New Issue
Block a user