| 186 | |
| 187 | template<class Optional> |
| 188 | constexpr void assign(Optional&& rhs) noexcept(std::is_nothrow_constructible<T,Optional>::value && |
| 189 | std::is_nothrow_assignable<T&,Optional>::value) |
| 190 | { |
| 191 | if (this->active && rhs.active) |
| 192 | this->val = std::forward<Optional>(rhs).val; |
| 193 | else if (!this->active && rhs.active) |
| 194 | construct(std::forward<Optional>(rhs).val); |
| 195 | else if (this->active && !rhs.active) |
| 196 | destruct(); |
| 197 | } |
| 198 | |
| 199 | constexpr void destruct() noexcept(std::is_nothrow_destructible<T>::value) |
| 200 | { |
no test coverage detected