aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authoreshcherbin <eshcherbin@yandex-team.com>2025-02-03 10:23:16 +0300
committereshcherbin <eshcherbin@yandex-team.com>2025-02-03 10:35:19 +0300
commitc5ac5b79af1a34b914ac67de302f86744e23856b (patch)
tree4e60b970466670d7599579a12338bb136b193271 /library/cpp
parent6f9ffcd3daddd441911cbc0f35143aff80f044de (diff)
downloadydb-c5ac5b79af1a34b914ac67de302f86744e23856b.tar.gz
Make TCompactFlatMap formattable
commit_hash:e5c092a9d0375881554f1d3bc905c662070956bf
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/yt/compact_containers/compact_flat_map.h2
-rw-r--r--library/cpp/yt/string/format-inl.h5
-rw-r--r--library/cpp/yt/string/unittests/format_ut.cpp1
3 files changed, 7 insertions, 1 deletions
diff --git a/library/cpp/yt/compact_containers/compact_flat_map.h b/library/cpp/yt/compact_containers/compact_flat_map.h
index d4e9366843..49c8628c46 100644
--- a/library/cpp/yt/compact_containers/compact_flat_map.h
+++ b/library/cpp/yt/compact_containers/compact_flat_map.h
@@ -20,7 +20,7 @@ concept CComparisonAllowed = std::same_as<T, U> || CHasIsTransparentFlag<TCompar
///////////////////////////////////////////////////////////////////////////////
-//! A flat map implementation over TCompactTValueector that tries to keep data inline.
+//! A flat map implementation over TCompactVector that tries to keep data inline.
/*!
* Similarly to SmallSet, this is implemented via binary search over a sorted
* vector. Unlike SmallSet, however, this one never falls back to std::map (or
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h
index 83d6198674..22da423f89 100644
--- a/library/cpp/yt/string/format-inl.h
+++ b/library/cpp/yt/string/format-inl.h
@@ -11,6 +11,7 @@
#include <library/cpp/yt/assert/assert.h>
#include <library/cpp/yt/compact_containers/compact_vector.h>
+#include <library/cpp/yt/compact_containers/compact_flat_map.h>
#include <library/cpp/yt/containers/enum_indexed_array.h>
@@ -163,6 +164,10 @@ template <class... Ts>
constexpr bool CKnownKVRange<THashMap<Ts...>> = true;
template <class... Ts>
constexpr bool CKnownKVRange<THashMultiMap<Ts...>> = true;
+template <class... Ts>
+constexpr bool CKnownKVRange<TCompactFlatMap<Ts...>> = true;
+template <class K, class V, size_t N>
+constexpr bool CKnownKVRange<TCompactFlatMap<K, V, N>> = true;
// TODO(arkady-e1ppa): Uncomment me when
// https://github.com/llvm/llvm-project/issues/58534 is shipped.
diff --git a/library/cpp/yt/string/unittests/format_ut.cpp b/library/cpp/yt/string/unittests/format_ut.cpp
index f783efcf11..e2e23c737c 100644
--- a/library/cpp/yt/string/unittests/format_ut.cpp
+++ b/library/cpp/yt/string/unittests/format_ut.cpp
@@ -70,6 +70,7 @@ static_assert(CFormattable<std::multimap<int, int>>);
static_assert(CFormattable<THashSet<int>>);
static_assert(CFormattable<THashMap<int, int>>);
static_assert(CFormattable<THashMultiSet<int>>);
+static_assert(CFormattable<TCompactFlatMap<int, int, 2>>);
static_assert(CFormattable<std::pair<int, int>>);
static_assert(CFormattable<std::optional<int>>);
static_assert(CFormattable<TDuration>);