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

Function PassByConstReference

util/generic/strbuf_ut.cpp:334–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332
333 template <class T>
334 void PassByConstReference(const T& val) {
335 // In https://st.yandex-team.ru/IGNIETFERRO-294 was assumed that `const char[]` types are compile time strings
336 // and that CharTraits::Length may not be called for them. Unfortunately that is not true, `char[]` types
337 // are easily converted to `const char[]` if they are passed to a function accepting `const T&`.
338 UNIT_ASSERT(TStringBuf(val).size() == 5);
339 }
340
341 Y_UNIT_TEST(TestPassingArraysByConstReference) {
342 char data[] = "Hello\0word";

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected