aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakhropov <akhropov@yandex-team.com>2024-01-22 11:03:41 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-01-24 15:01:54 +0300
commitf9c0a703691c7d886cbae6a267bc7eed3f56896b (patch)
treee6575a503b69b3329d65455959114ee2cdec2d21
parentae37e459a4f622bab9f462a607ab443e45de71d4 (diff)
downloadydb-f9c0a703691c7d886cbae6a267bc7eed3f56896b.tar.gz
Fix error in TArrayRef constructor for a container: Elements with a different size should not be accepted even if they are convertible to TArrayRef value type.
-rw-r--r--util/generic/array_ref.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/generic/array_ref.h b/util/generic/array_ref.h
index 1ac60ac7d3..83d225c6ff 100644
--- a/util/generic/array_ref.h
+++ b/util/generic/array_ref.h
@@ -64,6 +64,9 @@ public:
: T_(container.data())
, S_(container.size())
{
+ static_assert(
+ sizeof(decltype(*container.data())) == sizeof(T),
+ "Attempt to create TArrayRef from a container of elements with a different size");
}
template <size_t N>