This commit is contained in:
Jeremy 2023-09-11 10:36:57 -04:00
parent 55e4aaceb0
commit 09ccc95814
No known key found for this signature in database
GPG Key ID: 3E11861CB34E158C

View File

@ -285,6 +285,8 @@ class optional {
};
public:
// clang-tidy false positive
// NOLINTNEXTLINE(modernize-use-equals-default)
optional() noexcept {}
optional(nullopt_t) noexcept {}
@ -326,6 +328,8 @@ public:
typename U = T,
typename std::enable_if<!std::is_same<typename std::decay<U>::type, optional<T>>::value, int>::type = 0
>
// clang-tidy false positive
// NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
optional(U&& value) : holds_value(true) {
new (static_cast<void*>(std::addressof(uvalue))) T(std::forward<U>(value));
}