diff --git a/src/util.h b/src/util.h index 7e575605cb7364..7527ec0909cefd 100644 --- a/src/util.h +++ b/src/util.h @@ -656,38 +656,6 @@ struct MallocedBuffer { MallocedBuffer& operator=(const MallocedBuffer&) = delete; }; -template -class NonCopyableMaybe { - public: - NonCopyableMaybe() : empty_(true) {} - explicit NonCopyableMaybe(T&& value) - : empty_(false), - value_(std::move(value)) {} - - bool IsEmpty() const { - return empty_; - } - - const T* get() const { - return empty_ ? nullptr : &value_; - } - - const T* operator->() const { - CHECK(!empty_); - return &value_; - } - - T&& Release() { - CHECK_EQ(empty_, false); - empty_ = true; - return std::move(value_); - } - - private: - bool empty_; - T value_; -}; - // Test whether some value can be called with (). template struct is_callable : std::is_function { };