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

Method SwapWithUndefined

library/cpp/json/writer/json_value.cpp:958–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

956 }
957
958 void TJsonValue::SwapWithUndefined(TJsonValue& output) noexcept {
959 if (Type == JSON_STRING) {
960 static_assert(std::is_nothrow_move_constructible<TString>::value, "noexcept violation! Add some try {} catch (...) logic");
961 new (&output.Value.String) TString(std::move(Value.String));
962 Value.String.~TString();
963 } else {
964 std::memcpy(&output.Value, &Value, sizeof(Value));
965 }
966 output.Type = Type;
967 Type = JSON_UNDEFINED;
968 }
969
970 void TJsonValue::Swap(TJsonValue& rhs) noexcept {
971 TJsonValue tmp(std::move(*this));

Callers 2

TJsonValueMethod · 0.45
SwapMethod · 0.45

Calls 1

moveFunction · 0.50

Tested by

no test coverage detected