Assigns from another optional (deep-copies the rhs value)
| 263 | |
| 264 | // Assigns from another optional<T> (deep-copies the rhs value) |
| 265 | void assign ( optional_base const& rhs ) |
| 266 | { |
| 267 | if (is_initialized()) |
| 268 | { |
| 269 | if ( rhs.is_initialized() ) |
| 270 | assign_value(rhs.get_impl()); |
| 271 | else destroy(); |
| 272 | } |
| 273 | else |
| 274 | { |
| 275 | if ( rhs.is_initialized() ) |
| 276 | construct(rhs.get_impl()); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES |
| 281 | // Assigns from another optional<T> (deep-moves the rhs value) |
no test coverage detected