! \brief swap two optional */
| 74 | } |
| 75 | /*! \brief swap two optional */ |
| 76 | void swap(optional<T>& other) { |
| 77 | std::swap(val, other.val); |
| 78 | std::swap(is_none, other.is_none); |
| 79 | } |
| 80 | /*! \brief set this object to hold value |
| 81 | * \param value the value to hold |
| 82 | * \return return self to support chain assignment |