utils: update optional & expected
Use the latest upstream versions.
This commit is contained in:
@ -1216,11 +1216,11 @@ class expected : private detail::expected_move_assign_base<T, E>,
|
|||||||
private detail::expected_delete_assign_base<T, E>,
|
private detail::expected_delete_assign_base<T, E>,
|
||||||
private detail::expected_default_ctor_base<T, E> {
|
private detail::expected_default_ctor_base<T, E> {
|
||||||
static_assert(!std::is_reference<T>::value, "T must not be a reference");
|
static_assert(!std::is_reference<T>::value, "T must not be a reference");
|
||||||
static_assert(!std::is_same<T, std::remove_cv<in_place_t>>::value,
|
static_assert(!std::is_same<T, std::remove_cv<in_place_t>::type>::value,
|
||||||
"T must not be in_place_t");
|
"T must not be in_place_t");
|
||||||
static_assert(!std::is_same<T, std::remove_cv<unexpect_t>>::value,
|
static_assert(!std::is_same<T, std::remove_cv<unexpect_t>::type>::value,
|
||||||
"T must not be unexpect_t");
|
"T must not be unexpect_t");
|
||||||
static_assert(!std::is_same<T, std::remove_cv<unexpected<E>>>::value,
|
static_assert(!std::is_same<T, typename std::remove_cv<unexpected<E>>::type>::value,
|
||||||
"T must not be unexpected<E>");
|
"T must not be unexpected<E>");
|
||||||
static_assert(!std::is_reference<E>::value, "E must not be a reference");
|
static_assert(!std::is_reference<E>::value, "E must not be a reference");
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
///
|
///
|
||||||
// optional - An implementation of std::optional with extensions
|
// optional - An implementation of std::optional with extensions
|
||||||
// Written in 2017 by Simon Brand (simonrbrand@gmail.com, @TartanLlama)
|
// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama)
|
||||||
//
|
//
|
||||||
// Documentation available at https://tl.tartanllama.xyz/
|
// Documentation available at https://tl.tartanllama.xyz/
|
||||||
//
|
//
|
||||||
@ -452,7 +452,8 @@ struct optional_copy_base<T, false> : optional_operations_base<T> {
|
|||||||
using optional_operations_base<T>::optional_operations_base;
|
using optional_operations_base<T>::optional_operations_base;
|
||||||
|
|
||||||
optional_copy_base() = default;
|
optional_copy_base() = default;
|
||||||
optional_copy_base(const optional_copy_base &rhs) {
|
optional_copy_base(const optional_copy_base &rhs)
|
||||||
|
: optional_operations_base<T>() {
|
||||||
if (rhs.has_value()) {
|
if (rhs.has_value()) {
|
||||||
this->construct(rhs.get());
|
this->construct(rhs.get());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user