utils: update optional & expected

Use the latest upstream versions.
This commit is contained in:
Dirk-Jan C. Binnema
2022-02-16 21:52:43 +02:00
parent bc44666d88
commit c5538d5b14
2 changed files with 6 additions and 5 deletions

View File

@ -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_default_ctor_base<T, E> {
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");
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");
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>");
static_assert(!std::is_reference<E>::value, "E must not be a reference");

View File

@ -1,7 +1,7 @@
///
// 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/
//
@ -452,7 +452,8 @@ struct optional_copy_base<T, false> : optional_operations_base<T> {
using optional_operations_base<T>::optional_operations_base;
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()) {
this->construct(rhs.get());
} else {