yaml-cpp/include/yaml-cpp
Ted Lyngmo 5fe775248a Make Node move constructor and assignment operator noexcept (#809)
Move constructor:
 * m_isValid    (bool)                 exchange(rhs.m_isValid, true)
 * m_invalidKey (std::string)          std::move()
 * m_pMemory    (shared_memory_holder) std::move()
 * m_pNode      (node*)                exchange(rhs.m_pNode, nullptr)

 This leaves the moved-from Node as if it was just default constructed.

Move assignment:
 A sanity test is performed to check if it's a valid move, and
 if not: *this is returned (with an added assert() for debugging).

 A temporary Node is move constructed (using the move constructor), leaving
 the moved-from Node as if it was just default constructed.

 If this->m_pNode == nullptr, the same operation as AssignNode would do is done
 and *this is returned.

 if temporary.m_pNode == nullptr:
  m_pNode->set_null()
  swap(*this, temporary)
  return *this;

 Otherwise the merge step that AssignNode would do if both m_pNodes are not
 nullptr is done, using a new member function, AssignNodeDetail().

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
2020-02-15 13:29:00 +01:00
..
contrib Change NULL to nullptr (#805) 2020-01-20 17:14:55 -06:00
node Make Node move constructor and assignment operator noexcept (#809) 2020-02-15 13:29:00 +01:00
anchor.h Modernize: Use "using" instead of "typedef" (#754) 2019-10-02 11:14:49 -05:00
binary.h Static analysis fix: replace 0 and NULL with nullptr (#738) 2019-09-14 20:23:22 -04:00
dll.h Fix line-wrapping in comment in dll.h 2016-03-16 10:41:12 -07:00
emitfromevents.h Modernization: Use "override" when overriding base class methods (#753) 2019-10-02 09:21:17 -05:00
emitter.h Make SettingChange and StreamCharSourcemove constructors and assignment operators noexcept (#808) 2020-02-04 16:58:00 -06:00
emitterdef.h Renamed the None enumeration vaules to NoType to avoid a collision with X11's macro 2015-01-24 15:58:14 -06:00
emittermanip.h Pass std::string by const ref (#749) 2019-10-02 08:39:41 -05:00
emitterstyle.h Fix gcc warning 2015-01-24 14:47:00 -06:00
eventhandler.h Modernize: Use "default" for destructors and copy constructors (#751) 2019-10-02 08:38:49 -05:00
exceptions.h Move the YAML_CPP_NOEXCEPT macro to include/yaml-cpp/noexcept.h (#813) 2020-02-04 13:24:37 -06:00
mark.h More useful error messages. 2015-04-02 20:50:11 +01:00
noexcept.h Move the YAML_CPP_NOEXCEPT macro to include/yaml-cpp/noexcept.h (#813) 2020-02-04 13:24:37 -06:00
null.h Make null handling YAML 1.2 compliant. 2016-04-01 17:14:59 -05:00
ostream_wrapper.h Static analysis fix: replace 0 and NULL with nullptr (#738) 2019-09-14 20:23:22 -04:00
parser.h Disallow moving for the Parser. 2019-03-24 17:01:14 -05:00
stlemitter.h Run clang-format 2014-03-22 12:49:16 -05:00
traits.h Modernize: Use "using" instead of "typedef" (#754) 2019-10-02 11:14:49 -05:00
yaml.h Merge from core 2015-01-24 12:26:16 -06:00