aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorakhropov <akhropov@yandex-team.com>2024-01-22 11:03:41 +0300
committerakhropov <akhropov@yandex-team.com>2024-01-22 11:30:22 +0300
commit273c40fcb033921032b644d6baa08dcd110d5f8b (patch)
tree14d237f494c10bfa0f26fd97af748b7f0a4b5484 /util
parent4aed28b2342daffc339702543f5a393176cbfe12 (diff)
downloadydb-273c40fcb033921032b644d6baa08dcd110d5f8b.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.
Diffstat (limited to 'util')
-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>