| 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)); |
no test coverage detected