Commit f693e2e5 authored by Kenton Varda's avatar Kenton Varda

Try to fix MSVC.

parent d0dea8e5
...@@ -870,7 +870,7 @@ class NullableValue { ...@@ -870,7 +870,7 @@ class NullableValue {
// boolean flag indicating nullness. // boolean flag indicating nullness.
public: public:
inline NullableValue(NullableValue&& other) noexcept(noexcept(T(instance<T&&>()))) inline NullableValue(NullableValue&& other)
: isSet(other.isSet) { : isSet(other.isSet) {
if (isSet) { if (isSet) {
ctor(value, kj::mv(other.value)); ctor(value, kj::mv(other.value));
...@@ -922,8 +922,8 @@ public: ...@@ -922,8 +922,8 @@ public:
return value; return value;
} }
inline NullableValue() noexcept: isSet(false) {} inline NullableValue(): isSet(false) {}
inline NullableValue(T&& t) noexcept(noexcept(T(instance<T&&>()))) inline NullableValue(T&& t)
: isSet(true) { : isSet(true) {
ctor(value, kj::mv(t)); ctor(value, kj::mv(t));
} }
...@@ -940,7 +940,7 @@ public: ...@@ -940,7 +940,7 @@ public:
if (isSet) ctor(value, *t); if (isSet) ctor(value, *t);
} }
template <typename U> template <typename U>
inline NullableValue(NullableValue<U>&& other) noexcept(noexcept(T(instance<U&&>()))) inline NullableValue(NullableValue<U>&& other)
: isSet(other.isSet) { : isSet(other.isSet) {
if (isSet) { if (isSet) {
ctor(value, kj::mv(other.value)); ctor(value, kj::mv(other.value));
...@@ -1106,16 +1106,16 @@ class Maybe { ...@@ -1106,16 +1106,16 @@ class Maybe {
public: public:
Maybe(): ptr(nullptr) {} Maybe(): ptr(nullptr) {}
Maybe(T&& t) noexcept(noexcept(T(instance<T&&>()))): ptr(kj::mv(t)) {} Maybe(T&& t): ptr(kj::mv(t)) {}
Maybe(T& t): ptr(t) {} Maybe(T& t): ptr(t) {}
Maybe(const T& t): ptr(t) {} Maybe(const T& t): ptr(t) {}
Maybe(const T* t) noexcept: ptr(t) {} Maybe(const T* t): ptr(t) {}
Maybe(Maybe&& other) noexcept(noexcept(T(instance<T&&>()))): ptr(kj::mv(other.ptr)) {} Maybe(Maybe&& other): ptr(kj::mv(other.ptr)) {}
Maybe(const Maybe& other): ptr(other.ptr) {} Maybe(const Maybe& other): ptr(other.ptr) {}
Maybe(Maybe& other): ptr(other.ptr) {} Maybe(Maybe& other): ptr(other.ptr) {}
template <typename U> template <typename U>
Maybe(Maybe<U>&& other) noexcept(noexcept(T(instance<U&&>()))) { Maybe(Maybe<U>&& other) {
KJ_IF_MAYBE(val, kj::mv(other)) { KJ_IF_MAYBE(val, kj::mv(other)) {
ptr.emplace(kj::mv(*val)); ptr.emplace(kj::mv(*val));
} }
...@@ -1127,7 +1127,7 @@ public: ...@@ -1127,7 +1127,7 @@ public:
} }
} }
Maybe(decltype(nullptr)) noexcept: ptr(nullptr) {} Maybe(decltype(nullptr)): ptr(nullptr) {}
template <typename... Params> template <typename... Params>
inline T& emplace(Params&&... params) { inline T& emplace(Params&&... params) {
...@@ -1252,22 +1252,22 @@ private: ...@@ -1252,22 +1252,22 @@ private:
template <typename T> template <typename T>
class Maybe<T&>: public DisallowConstCopyIfNotConst<T> { class Maybe<T&>: public DisallowConstCopyIfNotConst<T> {
public: public:
Maybe() noexcept: ptr(nullptr) {} Maybe(): ptr(nullptr) {}
Maybe(T& t) noexcept: ptr(&t) {} Maybe(T& t): ptr(&t) {}
Maybe(T* t) noexcept: ptr(t) {} Maybe(T* t): ptr(t) {}
template <typename U> template <typename U>
inline Maybe(Maybe<U&>& other) noexcept: ptr(other.ptr) {} inline Maybe(Maybe<U&>& other): ptr(other.ptr) {}
template <typename U> template <typename U>
inline Maybe(const Maybe<U&>& other) noexcept: ptr(const_cast<const U*>(other.ptr)) {} inline Maybe(const Maybe<U&>& other): ptr(const_cast<const U*>(other.ptr)) {}
inline Maybe(decltype(nullptr)) noexcept: ptr(nullptr) {} inline Maybe(decltype(nullptr)): ptr(nullptr) {}
inline Maybe& operator=(T& other) noexcept { ptr = &other; return *this; } inline Maybe& operator=(T& other) { ptr = &other; return *this; }
inline Maybe& operator=(T* other) noexcept { ptr = other; return *this; } inline Maybe& operator=(T* other) { ptr = other; return *this; }
template <typename U> template <typename U>
inline Maybe& operator=(Maybe<U&>& other) noexcept { ptr = other.ptr; return *this; } inline Maybe& operator=(Maybe<U&>& other) { ptr = other.ptr; return *this; }
template <typename U> template <typename U>
inline Maybe& operator=(const Maybe<const U&>& other) noexcept { ptr = other.ptr; return *this; } inline Maybe& operator=(const Maybe<const U&>& other) { ptr = other.ptr; return *this; }
inline bool operator==(decltype(nullptr)) const { return ptr == nullptr; } inline bool operator==(decltype(nullptr)) const { return ptr == nullptr; }
inline bool operator!=(decltype(nullptr)) const { return ptr != nullptr; } inline bool operator!=(decltype(nullptr)) const { return ptr != nullptr; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment