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

Method SwapWithUndefined

library/cpp/json/ordered_maps/json_value_ordered.cpp:1034–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032 }
1033
1034 void TJsonValue::SwapWithUndefined(TJsonValue& output) noexcept {
1035 if (Type == JSON_STRING) {
1036 static_assert(std::is_nothrow_move_constructible<TString>::value, "noexcept violation! Add some try {} catch (...) logic");
1037 new (&output.Value.String) TString(std::move(Value.String));
1038 Value.String.~TString();
1039 } else {
1040 std::memcpy(&output.Value, &Value, sizeof(Value));
1041 }
1042 output.Type = Type;
1043 Type = JSON_UNDEFINED;
1044 }
1045
1046 void TJsonValue::Swap(TJsonValue& rhs) noexcept {
1047 TJsonValue tmp(std::move(*this));

Callers 2

TJsonValueMethod · 0.45
SwapMethod · 0.45

Calls 1

moveFunction · 0.50

Tested by

no test coverage detected