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

Function DetachAndFixPointers

library/cpp/containers/cow_string/cow_string.cpp:50–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49template <class TStringType>
50static void DetachAndFixPointers(TStringType& text, typename TStringType::value_type*& p, const typename TStringType::value_type*& pe) {
51 const auto pos = p - text.data();
52 const auto count = pe - p;
53 p = text.Detach() + pos;
54 pe = p + count;
55}
56
57template <class TStringType, typename F>
58static bool ModifyStringSymbolwise(TStringType& text, size_t pos, size_t count, F&& f) {

Callers 2

ModifyStringSymbolwiseFunction · 0.70
to_titleMethod · 0.70

Calls 2

dataMethod · 0.45
DetachMethod · 0.45

Tested by

no test coverage detected