Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1750 Add @note about invalidating move in expected
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <[email protected]>
  • Loading branch information
mossmaurice committed Oct 19, 2022
1 parent 0355ec3 commit 8df1f7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions iceoryx_hoofs/include/iceoryx_hoofs/cxx/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class IOX_NO_DISCARD expected<ErrorType> : public FunctionalInterface<expected<E

/// @brief the move constructor calls the move constructor of the contained success value
/// or the error value - depending on what is stored in the expected
/// @note The move c'tor does not explicitly invalidate the moved-from object but relies on the move c'tor of
/// ErrorType to correctly invalidate the stored object
expected(expected&& rhs) noexcept;

#if defined(_WIN32)
Expand All @@ -179,6 +181,8 @@ class IOX_NO_DISCARD expected<ErrorType> : public FunctionalInterface<expected<E

/// @brief calls the move assignment operator of the contained success value
/// or the error value - depending on what is stored in the expected
/// @note The move assign operator does not explicitly invalidate the moved-from object but relies on the move
/// assign operator of ErrorType to correctly invalidate the stored object
expected& operator=(expected&& rhs) noexcept;

#if defined(_WIN32)
Expand Down Expand Up @@ -277,6 +281,8 @@ class IOX_NO_DISCARD expected<ValueType, ErrorType>

/// @brief the move constructor calls the move constructor of the contained success value
/// or the error value - depending on what is stored in the expected
/// @note The move c'tor does not explicitly invalidate the moved-from object but relies on the move c'tor of
/// ValueType or ErrorType to correctly invalidate the stored object
expected(expected&& rhs) noexcept;

/// @brief calls the destructor of the success value or error value - depending on what
Expand All @@ -289,6 +295,8 @@ class IOX_NO_DISCARD expected<ValueType, ErrorType>

/// @brief calls the move assignment operator of the contained success value
/// or the error value - depending on what is stored in the expected
/// @note The move assign operator does not explicitly invalidate the moved-from object but relies on the move
/// assign operator of ValueType or ErrorType to correctly invalidate the stored object
expected& operator=(expected&& rhs) noexcept;

/// @brief constructs an expected which is signaling success and uses the value
Expand Down

0 comments on commit 8df1f7e

Please sign in to comment.