this commit is too big

This commit is contained in:
fourtf
2018-08-02 14:23:27 +02:00
parent 3b3c5d8d75
commit c2e2dfb577
186 changed files with 3626 additions and 2656 deletions
+14 -1
View File
@@ -1,5 +1,7 @@
#pragma once
#include <type_traits>
namespace chatterino {
template <typename T>
@@ -23,7 +25,7 @@ public:
return element_;
}
T &operator*() const
typename std::add_lvalue_reference<T>::type &operator*() const
{
assert(this->hasElement());
@@ -52,6 +54,17 @@ public:
return this->hasElement();
}
bool operator!() const
{
return !this->hasElement();
}
template <typename X = T, typename = std::enable_if_t<!std::is_const<X>::value>>
operator NullablePtr<const T>() const
{
return NullablePtr<const T>(this->element_);
}
private:
T *element_;
};