aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/ptr.h
diff options
context:
space:
mode:
authorVasily Gerasimov <UgnineSirdis@gmail.com>2022-02-10 16:49:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:10 +0300
commit1eb755fbca92172a6aec2f57371b2b3a19dfab43 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/ptr.h
parent6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (diff)
downloadydb-1eb755fbca92172a6aec2f57371b2b3a19dfab43.tar.gz
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/ptr.h')
-rw-r--r--util/generic/ptr.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/util/generic/ptr.h b/util/generic/ptr.h
index 49a6fca6ae..19db0e3ec5 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>;