Skip to content

Commit 67408f7

Browse files
Fix to compile under standard clang16: static_assert in template in ydb/core/tx/replication/service/json_change_record.cpp (#28199)
2 parents 920ae73 + 0ac1b43 commit 67408f7

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

ydb/core/tx/replication/service/json_change_record.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,29 @@ static bool ParseKey(TVector<TCell>& cells,
7171
return true;
7272
}
7373

74-
template <typename T>
75-
static bool TransformKey(T& to,
74+
static bool TransformKey(NKikimrTxDataShard::TEvApplyReplicationChanges::TChange& to,
7675
const NJson::TJsonValue::TArray& from, TLightweightSchema::TCPtr schema, TMemoryPool& pool, TString& error)
7776
{
7877
TVector<TCell> cells;
7978
if (!ParseKey(cells, from, schema, pool, error)) {
8079
return false;
8180
}
8281

83-
if constexpr (std::is_same_v<T, NKikimrTxDataShard::TEvApplyReplicationChanges::TChange>) {
84-
to.SetKey(TSerializedCellVec::Serialize(cells));
85-
} else if constexpr (std::is_same_v<T, TMaybe<TOwnedCellVec>>) {
86-
to.ConstructInPlace(cells);
87-
} else {
88-
static_assert(false, "Unsupported type");
82+
to.SetKey(TSerializedCellVec::Serialize(cells));
83+
84+
return true;
85+
}
86+
87+
static bool TransformKey(TMaybe<TOwnedCellVec>& to,
88+
const NJson::TJsonValue::TArray& from, TLightweightSchema::TCPtr schema, TMemoryPool& pool, TString& error)
89+
{
90+
TVector<TCell> cells;
91+
if (!ParseKey(cells, from, schema, pool, error)) {
92+
return false;
8993
}
9094

95+
to.ConstructInPlace(cells);
96+
9197
return true;
9298
}
9399

0 commit comments

Comments
 (0)