From c90258664d8f7f0071489f179cf68b16d3d87f28 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 24 Jan 2021 01:14:13 +0300 Subject: [PATCH] Removed unused StaticNeverFreedPointer class from utils. --- Telegram/SourceFiles/core/utils.h | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index f71ba5216..1d7f833ec 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -216,46 +216,3 @@ private: T *_p; }; - -// This pointer is used for static non-POD variables that are allocated -// on first use by constructor and are never automatically freed. -template -class StaticNeverFreedPointer { -public: - explicit StaticNeverFreedPointer(T *p) : _p(p) { - } - StaticNeverFreedPointer(const StaticNeverFreedPointer &other) = delete; - StaticNeverFreedPointer &operator=(const StaticNeverFreedPointer &other) = delete; - - T *data() const { - return _p; - } - T *release() { - return base::take(_p); - } - void reset(T *p = nullptr) { - delete _p; - _p = p; - } - bool isNull() const { - return data() == nullptr; - } - - void clear() { - reset(); - } - T *operator->() const { - return data(); - } - T &operator*() const { - Assert(!isNull()); - return *data(); - } - explicit operator bool() const { - return !isNull(); - } - -private: - T *_p = nullptr; - -};