MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / swap

Function swap

3rd/nlohmann_json/include/nlohmann/json.hpp:6108–6121  ·  view source on GitHub ↗

! @brief exchanges the values Exchanges the contents of the JSON value with those of @a other. Does not invoke any move, copy, or swap operations on individual elements. All iterators and references remain valid. The past-the-end iterator is invalidated. @param[in,out] other JSON value to exchange the contents with @complexity Constant. @liveexample{The example

Source from the content-addressed store, hash-verified

6106 @since version 1.0.0
6107 */
6108 void swap(reference other) noexcept (
6109 std::is_nothrow_move_constructible<value_t>::value&&
6110 std::is_nothrow_move_assignable<value_t>::value&&
6111 std::is_nothrow_move_constructible<json_value>::value&&
6112 std::is_nothrow_move_assignable<json_value>::value
6113 )
6114 {
6115 std::swap(m_type, other.m_type);
6116 std::swap(m_value, other.m_value);
6117
6118 set_parents();
6119 other.set_parents();
6120 assert_invariant();
6121 }
6122
6123 /*!
6124 @brief exchanges the values

Callers 5

json.hppFile · 0.70
swapMethod · 0.50
ShuffleRangeFunction · 0.50
DistanceMethod · 0.50

Calls 9

stringFunction · 0.85
set_parentsFunction · 0.70
is_arrayFunction · 0.70
createFunction · 0.70
type_nameFunction · 0.70
is_objectFunction · 0.70
is_stringFunction · 0.70
is_binaryFunction · 0.70
swapMethod · 0.45

Tested by 2

swapMethod · 0.40
ShuffleRangeFunction · 0.40