diff options
author | Vasily Gerasimov <UgnineSirdis@gmail.com> | 2022-02-10 16:49:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:09 +0300 |
commit | 6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (patch) | |
tree | f69637041e6fed76ebae0c74ae1fa0c4be6ab5b4 /util/generic/ptr.h | |
parent | e5d4696304c6689379ac7ce334512404d4b7836c (diff) | |
download | ydb-6cdc8f140213c595e4ad38bc3d97fcef1146b8c3.tar.gz |
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/generic/ptr.h')
-rw-r--r-- | util/generic/ptr.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/util/generic/ptr.h b/util/generic/ptr.h index 19db0e3ec5..49a6fca6ae 100644 --- a/util/generic/ptr.h +++ b/util/generic/ptr.h @@ -602,17 +602,17 @@ private: mutable T* T_; }; -template <class T, class Ops> +template <class T, class Ops> struct THash<TIntrusivePtr<T, Ops>>: THash<const T*> { - using THash<const T*>::operator(); - inline size_t operator()(const TIntrusivePtr<T, Ops>& ptr) const { - return THash<const T*>::operator()(ptr.Get()); - } -}; - + using THash<const T*>::operator(); + inline size_t operator()(const TIntrusivePtr<T, Ops>& ptr) const { + return THash<const T*>::operator()(ptr.Get()); + } +}; + // Behaves like TIntrusivePtr but returns const T* to prevent user from accidentally modifying the referenced object. template <class T, class Ops> -class TIntrusiveConstPtr: public TPointerBase<TIntrusiveConstPtr<T, Ops>, const T> { +class TIntrusiveConstPtr: public TPointerBase<TIntrusiveConstPtr<T, Ops>, const T> { public: inline TIntrusiveConstPtr(T* t = nullptr) noexcept // we need a non-const pointer to Ref(), UnRef() and eventually delete it. : T_(t) @@ -718,13 +718,13 @@ private: template <class T, class Ops> struct THash<TIntrusiveConstPtr<T, Ops>>: THash<const T*> { - using THash<const T*>::operator(); - inline size_t operator()(const TIntrusiveConstPtr<T, Ops>& ptr) const { - return THash<const T*>::operator()(ptr.Get()); - } -}; - -template <class T, class Ops> + using THash<const T*>::operator(); + inline size_t operator()(const TIntrusiveConstPtr<T, Ops>& ptr) const { + return THash<const T*>::operator()(ptr.Get()); + } +}; + +template <class T, class Ops> class TSimpleIntrusiveOps { using TFunc = void (*)(T*) #if __cplusplus >= 201703 @@ -932,14 +932,14 @@ private: C* C_; }; -template <class T, class C, class D> +template <class T, class C, class D> struct THash<TSharedPtr<T, C, D>>: THash<const T*> { - using THash<const T*>::operator(); - inline size_t operator()(const TSharedPtr<T, C, D>& ptr) const { - return THash<const T*>::operator()(ptr.Get()); - } -}; - + using THash<const T*>::operator(); + inline size_t operator()(const TSharedPtr<T, C, D>& ptr) const { + return THash<const T*>::operator()(ptr.Get()); + } +}; + template <class T, class D = TDelete> using TAtomicSharedPtr = TSharedPtr<T, TAtomicCounter, D>; |