From b49a91627faa6411023f7823250337cc1a71af82 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Fri, 31 Jul 2020 20:36:17 -0400 Subject: move clipp/parse logic into console project --- common/external/nillable.h | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 common/external/nillable.h (limited to 'common/external/nillable.h') diff --git a/common/external/nillable.h b/common/external/nillable.h deleted file mode 100644 index 40cf01c..0000000 --- a/common/external/nillable.h +++ /dev/null @@ -1,30 +0,0 @@ -inline constexpr struct nil_t {} nil; - -// Requirements: T is default-constructible and trivially-destructible -template -struct nillable { - bool has_value = false; - T value; - - nillable() = default; - - nillable(nil_t) : nillable() {} - nillable(const T& v) : has_value(true), value(v) {} - - nillable& operator=(nil_t) { - has_value = false; - return *this; - } - nillable& operator=(const T& v) { - value = v; - has_value = true; - return *this; - } - - const T* operator->() const { return &value; } - T* operator->() { return &value; } - - explicit operator bool() const { return has_value; } -}; - -template nillable(T)->nillable; -- cgit v1.2.3