diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/yt/memory/leaky_singleton-inl.h | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'library/cpp/yt/memory/leaky_singleton-inl.h')
-rw-r--r-- | library/cpp/yt/memory/leaky_singleton-inl.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/library/cpp/yt/memory/leaky_singleton-inl.h b/library/cpp/yt/memory/leaky_singleton-inl.h deleted file mode 100644 index 932747c921..0000000000 --- a/library/cpp/yt/memory/leaky_singleton-inl.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef LEAKY_SINGLETON_INL_H_ -#error "Direct inclusion of this file is not allowed, include leaky_singleton.h" -// For the sake of sane code completion. -#include "leaky_singleton.h" -#endif - -namespace NYT { - -//////////////////////////////////////////////////////////////////////////////// - -template <class T> -TLeakyStorage<T>::TLeakyStorage() -{ - new (Get()) T(); -} - -template <class T> -T* TLeakyStorage<T>::Get() -{ - return reinterpret_cast<T*>(Buffer_); -} - -//////////////////////////////////////////////////////////////////////////////// - -template <class T> -T* LeakySingleton() -{ - static TLeakyStorage<T> Storage; - return Storage.Get(); -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT |