mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
commit
065f4880c3
@ -223,12 +223,12 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
template <typename U, typename Dummy = std::enable_if_t<std::is_convertible<U, T>::value>>
|
template <typename U, typename Dummy = std::enable_if_t<std::is_convertible<U, T>::value>>
|
||||||
maybe_null_dbg(const maybe_null_dbg<U> &other) : ptr_(other.get()), tested_(false) {}
|
maybe_null_dbg(const maybe_null_dbg<U> &other) : ptr_(other.ptr_), tested_(false) {}
|
||||||
|
|
||||||
template <typename U, typename Dummy = std::enable_if_t<std::is_convertible<U, T>::value>>
|
template <typename U, typename Dummy = std::enable_if_t<std::is_convertible<U, T>::value>>
|
||||||
maybe_null_dbg& operator=(const maybe_null_dbg<U> &other)
|
maybe_null_dbg& operator=(const maybe_null_dbg<U> &other)
|
||||||
{
|
{
|
||||||
ptr_ = other.get();
|
ptr_ = other.ptr_;
|
||||||
tested_ = false;
|
tested_ = false;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -289,9 +289,7 @@ SUITE(MaybeNullTests)
|
|||||||
mnBase_dbg2 = nnBase; // maybe_null_dbg<T> = not_null<T>
|
mnBase_dbg2 = nnBase; // maybe_null_dbg<T> = not_null<T>
|
||||||
|
|
||||||
maybe_null_dbg<MyDerived*> mnDerived_dbg(&derived);
|
maybe_null_dbg<MyDerived*> mnDerived_dbg(&derived);
|
||||||
CHECK(mnDerived_dbg.present());
|
|
||||||
mnBase_dbg2 = mnDerived_dbg; // maybe_null_dbg<T> = maybe_null_dbg<U>
|
mnBase_dbg2 = mnDerived_dbg; // maybe_null_dbg<T> = maybe_null_dbg<U>
|
||||||
|
|
||||||
mnBase_dbg1 = &derived; // maybe_null_dbg<T> = U;
|
mnBase_dbg1 = &derived; // maybe_null_dbg<T> = U;
|
||||||
mnBase_dbg1 = nnDerived; // maybe_null_dbg<T> = not_null<U>
|
mnBase_dbg1 = nnDerived; // maybe_null_dbg<T> = not_null<U>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user