MCPcopy Create free account
hub / github.com/catboost/catboost / LoadAlternativeIf

Function LoadAlternativeIf

library/cpp/chromium_trace/saveload.cpp:88–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87template <size_t I, class T>
88void LoadAlternativeIf(IInputStream* in, TMemoryPool& pool, T& variant, size_t i) {
89 if (i == I) {
90 auto& x = variant.template emplace<I>();
91 if constexpr (std::is_same_v<decltype(x), TStringBuf&>) {
92 ::LoadStr(in, x, pool);
93 } else {
94 ::Load(in, x, pool);
95 }
96 }
97}
98
99template <class T, size_t... Is>
100void LoadVariant(IInputStream* in, TMemoryPool& pool, T& variant, std::index_sequence<Is...>) {

Callers

nothing calls this directly

Calls 2

LoadStrFunction · 0.85
LoadFunction · 0.50

Tested by

no test coverage detected