MCPcopy Create free account
hub / github.com/JDAI-CV/DNNLibrary / noexcept

Method noexcept

include/common/optional.h:1115–1125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1113 void swap( optional & other )
1114#if optional_CPP11_OR_GREATER
1115 noexcept(
1116 std::is_nothrow_move_constructible<T>::value
1117 && noexcept( std::swap( std::declval<T&>(), std::declval<T&>() ) )
1118 )
1119#endif
1120 {
1121 using std::swap;
1122 if ( has_value() == true && other.has_value() == true ) { swap( **this, *other ); }
1123 else if ( has_value() == false && other.has_value() == true ) { initialize( *other ); other.reset(); }
1124 else if ( has_value() == true && other.has_value() == false ) { other.initialize( **this ); reset(); }
1125 }
1126
1127 // x.x.3.5, observers
1128

Callers

nothing calls this directly

Calls 4

has_valueFunction · 0.85
swapFunction · 0.85
initializeMethod · 0.80
has_valueMethod · 0.45

Tested by

no test coverage detected