aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorsabdenovch <sabdenovch@yandex-team.com>2023-08-28 18:11:46 +0300
committersabdenovch <sabdenovch@yandex-team.com>2023-08-28 18:41:07 +0300
commit4d9954dde66b7a3383ca8cfa5540bf5bfbb19c54 (patch)
tree89f57348d604223af4893039750d898fd5a8d04e /library/cpp
parent62ef0aa2df21d7c3b1ef231053664f2c81dd2515 (diff)
downloadydb-4d9954dde66b7a3383ca8cfa5540bf5bfbb19c54.tar.gz
Removed the last typedefs in the codebase
removed a lot of typedefs and turned a couple of std::pairs into something more meaningful
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/yt/memory/intrusive_ptr.h2
-rw-r--r--library/cpp/yt/memory/new.h2
-rw-r--r--library/cpp/yt/memory/range.h8
-rw-r--r--library/cpp/yt/memory/unittests/atomic_intrusive_ptr_ut.cpp4
-rw-r--r--library/cpp/yt/memory/unittests/intrusive_ptr_ut.cpp4
-rw-r--r--library/cpp/yt/memory/unittests/weak_ptr_ut.cpp12
-rw-r--r--library/cpp/yt/memory/weak_ptr.h2
-rw-r--r--library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp8
8 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/yt/memory/intrusive_ptr.h b/library/cpp/yt/memory/intrusive_ptr.h
index 788abea08f..1da3b06966 100644
--- a/library/cpp/yt/memory/intrusive_ptr.h
+++ b/library/cpp/yt/memory/intrusive_ptr.h
@@ -16,7 +16,7 @@ template <class T>
class TIntrusivePtr
{
public:
- typedef T TUnderlying;
+ using TUnderlying = T;
constexpr TIntrusivePtr() noexcept
{ }
diff --git a/library/cpp/yt/memory/new.h b/library/cpp/yt/memory/new.h
index 7108b0e7a0..a9591724ed 100644
--- a/library/cpp/yt/memory/new.h
+++ b/library/cpp/yt/memory/new.h
@@ -28,7 +28,7 @@ namespace NYT {
* TFoo();
* };
*
- * typedef TIntrusivePtr<TFoo> TFooPtr;
+ * using TFooPtr = TIntrusivePtr<TFoo>;
*
* void RegisterObject(TFooPtr foo)
* {
diff --git a/library/cpp/yt/memory/range.h b/library/cpp/yt/memory/range.h
index ac1f138b30..5881fc3fbf 100644
--- a/library/cpp/yt/memory/range.h
+++ b/library/cpp/yt/memory/range.h
@@ -55,9 +55,9 @@ template <class T>
class TRange
{
public:
- typedef const T* iterator;
- typedef const T* const_iterator;
- typedef size_t size_type;
+ using iterator = const T*;
+ using const_iterator = const T*;
+ using size_type = size_t;
//! Constructs a null TRange.
TRange()
@@ -311,7 +311,7 @@ class TMutableRange
: public TRange<T>
{
public:
- typedef T* iterator;
+ using iterator = T*;
//! Constructs a null TMutableRange.
TMutableRange()
diff --git a/library/cpp/yt/memory/unittests/atomic_intrusive_ptr_ut.cpp b/library/cpp/yt/memory/unittests/atomic_intrusive_ptr_ut.cpp
index f6a26e56b1..4811d20882 100644
--- a/library/cpp/yt/memory/unittests/atomic_intrusive_ptr_ut.cpp
+++ b/library/cpp/yt/memory/unittests/atomic_intrusive_ptr_ut.cpp
@@ -42,8 +42,8 @@ struct TIntricateObject
}
};
-typedef TIntrusivePtr<TIntricateObject> TIntricateObjectPtr;
-typedef TIntrusivePtr<const TIntricateObject> TConstIntricateObjectPtr;
+using TIntricateObjectPtr = TIntrusivePtr<TIntricateObject>;
+using TConstIntricateObjectPtr = TIntrusivePtr<const TIntricateObject>;
void Ref(TIntricateObject* obj, int n = 1)
{
diff --git a/library/cpp/yt/memory/unittests/intrusive_ptr_ut.cpp b/library/cpp/yt/memory/unittests/intrusive_ptr_ut.cpp
index ede5deb80a..f20e5cff10 100644
--- a/library/cpp/yt/memory/unittests/intrusive_ptr_ut.cpp
+++ b/library/cpp/yt/memory/unittests/intrusive_ptr_ut.cpp
@@ -48,7 +48,7 @@ struct TIntricateObject
}
};
-typedef TIntrusivePtr<TIntricateObject> TIntricateObjectPtr;
+using TIntricateObjectPtr = TIntrusivePtr<TIntricateObject>;
void Ref(TIntricateObject* obj, int /*n*/ = 1)
{
@@ -449,7 +449,7 @@ TEST(TIntrusivePtrTest, CompareWithNullptr)
template <class T>
void TestIntrusivePtrBehavior()
{
- typedef TIntrusivePtr<T> TMyPtr;
+ using TMyPtr = TIntrusivePtr<T>;
TStringStream output;
{
diff --git a/library/cpp/yt/memory/unittests/weak_ptr_ut.cpp b/library/cpp/yt/memory/unittests/weak_ptr_ut.cpp
index 6359d0bd66..f19809100f 100644
--- a/library/cpp/yt/memory/unittests/weak_ptr_ut.cpp
+++ b/library/cpp/yt/memory/unittests/weak_ptr_ut.cpp
@@ -63,8 +63,8 @@ private:
TIntricateObject& operator=(TIntricateObject&&);
};
-typedef TIntrusivePtr<TIntricateObject> TIntricateObjectPtr;
-typedef TWeakPtr<TIntricateObject> TIntricateObjectWkPtr;
+using TIntricateObjectPtr = TIntrusivePtr<TIntricateObject>;
+using TIntricateObjectWkPtr = TWeakPtr<TIntricateObject>;
class TDerivedIntricateObject
: public TIntricateObject
@@ -74,8 +74,8 @@ private:
[[maybe_unused]] std::array<char, 32> Payload;
};
-typedef TIntrusivePtr<TDerivedIntricateObject> TDerivedIntricateObjectPtr;
-typedef TWeakPtr<TDerivedIntricateObject> TDerivedIntricateObjectWkPtr;
+using TDerivedIntricateObjectPtr = TIntrusivePtr<TDerivedIntricateObject>;
+using TDerivedIntricateObjectWkPtr = TWeakPtr<TDerivedIntricateObject>;
MATCHER_P2(HasRefCounts, strongRefs, weakRefs,
"The object has "
@@ -383,8 +383,8 @@ void PrintTo(const TSlowlyDyingObject& arg, ::std::ostream* os)
PrintExtrinsicRefCounted(arg, os);
}
-typedef TIntrusivePtr<TSlowlyDyingObject> TSlowlyDyingObjectPtr;
-typedef TWeakPtr<TSlowlyDyingObject> TSlowlyDyingObjectWkPtr;
+using TSlowlyDyingObjectPtr = TIntrusivePtr<TSlowlyDyingObject>;
+using TSlowlyDyingObjectWkPtr = TWeakPtr<TSlowlyDyingObject>;
static void* AsynchronousDeleter(void* param)
{
diff --git a/library/cpp/yt/memory/weak_ptr.h b/library/cpp/yt/memory/weak_ptr.h
index 6d2c5f0c01..a5a7f0a525 100644
--- a/library/cpp/yt/memory/weak_ptr.h
+++ b/library/cpp/yt/memory/weak_ptr.h
@@ -12,7 +12,7 @@ template <class T>
class TWeakPtr
{
public:
- typedef T TUnderlying;
+ using TUnderlying = T;
//! Empty constructor.
TWeakPtr() = default;
diff --git a/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp b/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp
index 1e30c0a532..715de64dfb 100644
--- a/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp
+++ b/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp
@@ -205,12 +205,12 @@ protected:
};
-typedef ::testing::Types<TCompactVector<Constructable, 0>,
+using CompactVectorTestTypes = ::testing::Types<TCompactVector<Constructable, 0>,
TCompactVector<Constructable, 1>,
TCompactVector<Constructable, 2>,
TCompactVector<Constructable, 4>,
TCompactVector<Constructable, 5>
- > CompactVectorTestTypes;
+ >;
TYPED_TEST_SUITE(CompactVectorTest, CompactVectorTestTypes);
// New vector test.
@@ -723,7 +723,7 @@ protected:
static size_t NumBuiltinElts(const TCompactVector<T, N>&) { return N; }
};
-typedef ::testing::Types<
+using DualCompactVectorTestTypes = ::testing::Types<
// Small mode -> Small mode.
std::pair<TCompactVector<Constructable, 4>, TCompactVector<Constructable, 4>>,
// Small mode -> Big mode.
@@ -732,7 +732,7 @@ typedef ::testing::Types<
std::pair<TCompactVector<Constructable, 2>, TCompactVector<Constructable, 4>>,
// Big mode -> Big mode.
std::pair<TCompactVector<Constructable, 2>, TCompactVector<Constructable, 2>>
- > DualCompactVectorTestTypes;
+ >;
TYPED_TEST_SUITE(DualCompactVectorsTest, DualCompactVectorTestTypes);