Skip to content

Commit

Permalink
Make TCompactFlatMap formattable
Browse files Browse the repository at this point in the history
commit_hash:e5c092a9d0375881554f1d3bc905c662070956bf
  • Loading branch information
eshcherbin committed Feb 3, 2025
1 parent 6f9ffcd commit c5ac5b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/cpp/yt/compact_containers/compact_flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions library/cpp/yt/string/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions library/cpp/yt/string/unittests/format_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>);
Expand Down

0 comments on commit c5ac5b7

Please sign in to comment.