diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-12-18 13:41:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 13:41:42 +0000 |
commit | 323ce495c58c95e05fb43d4223d4459706122c8f (patch) | |
tree | 22c877d4fc6741fc08db9ef8a0fcf3ee8c2e2ace /library/cpp | |
parent | dbb2dc86d1bdde9f34a360183633b5af47362e76 (diff) | |
parent | 9f2cb81b0a51939dc253e5b1f473734787986230 (diff) | |
download | ydb-323ce495c58c95e05fb43d4223d4459706122c8f.tar.gz |
Merge pull request #12697 from ydb-platform/mergelibs-241218-0753
Library import 241218-0753
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/tld/tlds-alpha-by-domain.txt | 2 | ||||
-rw-r--r-- | library/cpp/yt/memory/type_erasure.h | 4 | ||||
-rw-r--r-- | library/cpp/yt/memory/type_erasure_detail.h | 14 | ||||
-rw-r--r-- | library/cpp/yt/memory/unittests/type_erasure_ut.cpp | 8 |
4 files changed, 20 insertions, 8 deletions
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt index ce0708bbb8..133ab40cd8 100644 --- a/library/cpp/tld/tlds-alpha-by-domain.txt +++ b/library/cpp/tld/tlds-alpha-by-domain.txt @@ -1,4 +1,4 @@ -# Version 2024121000, Last Updated Tue Dec 10 07:07:01 2024 UTC +# Version 2024121600, Last Updated Mon Dec 16 07:07:02 2024 UTC AAA AARP ABB diff --git a/library/cpp/yt/memory/type_erasure.h b/library/cpp/yt/memory/type_erasure.h index 92c4eb34c5..4c4afaecb2 100644 --- a/library/cpp/yt/memory/type_erasure.h +++ b/library/cpp/yt/memory/type_erasure.h @@ -218,7 +218,7 @@ public: auto* mover = GetVTable().template GetFunctor<Mover<TStorage>>(); mover(std::move(other).GetStorage(), GetStorage()); - other.Holder_.Reset(); + other.Reset(); } } @@ -236,7 +236,7 @@ public: auto* mover = GetVTable().template GetFunctor<Mover<TStorage>>(); mover(std::move(other).GetStorage(), GetStorage()); - other.Holder_.Reset(); + other.Reset(); } return *this; diff --git a/library/cpp/yt/memory/type_erasure_detail.h b/library/cpp/yt/memory/type_erasure_detail.h index 5e158d3a81..3de22b8e0d 100644 --- a/library/cpp/yt/memory/type_erasure_detail.h +++ b/library/cpp/yt/memory/type_erasure_detail.h @@ -369,11 +369,19 @@ private: //////////////////////////////////////////////////////////////////////////////// template <class T, class TStorage> +struct TIsVTable + : public std::false_type +{ }; + +template <CStorage TStorage, class... TCpos> +struct TIsVTable<TVTable<TStorage, TCpos...>, TStorage> + : public std::true_type +{ }; + +template <class T, class TStorage> concept CVTableFor = CStorage<TStorage> && - requires (const T& t) { - [] <class... TCpos> (TVTable<TStorage, TCpos...>) { } (t); - }; + TIsVTable<std::remove_cvref_t<T>, TStorage>::value; //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/yt/memory/unittests/type_erasure_ut.cpp b/library/cpp/yt/memory/unittests/type_erasure_ut.cpp index e6e917d975..5c91d654bf 100644 --- a/library/cpp/yt/memory/unittests/type_erasure_ut.cpp +++ b/library/cpp/yt/memory/unittests/type_erasure_ut.cpp @@ -292,7 +292,10 @@ TEST(TAnyObjectTest, CvRefCorrectness) EXPECT_EQ(TestCpo(movedOut).Val, 11); } - EXPECT_EQ(cust.DtorCount, 5); + // NB(arkady-e1ppa): Moved out any should be + // actually empty thus moving out both moves object out + // and destroys the moved out object. + EXPECT_EQ(cust.DtorCount, 6); EXPECT_THROW(any.AnyCast<TCustomized2>(), NDetail::TBadAnyCast); } @@ -316,7 +319,8 @@ TEST(TAnyObjectTest, StaticVTableForAnyRef) EXPECT_EQ(TestCpo(movedOut).Val, 11); } EXPECT_EQ(cst.Value, 1111); - EXPECT_EQ(cst.DtorCount, 2); + // NB(arkady-e1ppa): See comment in previous test. + EXPECT_EQ(cst.DtorCount, 3); EXPECT_FALSE(any.IsValid()); } |