diff --git a/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp b/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp index 1416cc13cf8..44807c22667 100644 --- a/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp +++ b/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp @@ -325,14 +325,14 @@ TEST_F(expected_test, CreateWithErrorAndMoveAssignmentLeadsToMovedSource) EXPECT_EQ(sutDestination.get_error().m_b, B); } -TEST_F(expected_test, CreateWithOkFreeFunktionWithVoidValueTypeIsSuccessful) +TEST_F(expected_test, CreateWithOkFreeFunctionWithVoidValueTypeIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "6d582b25-1c7d-4519-837c-55d151b324ff"); expected sut = ok(); ASSERT_THAT(sut.has_error(), Eq(false)); } -TEST_F(expected_test, CreateWithOkFreeFunktionByCopyIsSuccessful) +TEST_F(expected_test, CreateWithOkFreeFunctionByCopyIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "d3c24c27-432d-4a4b-8d55-6e723bc88c46"); constexpr int VALUE = 111; @@ -341,7 +341,7 @@ TEST_F(expected_test, CreateWithOkFreeFunktionByCopyIsSuccessful) EXPECT_THAT(sut.value(), Eq(VALUE)); } -TEST_F(expected_test, CreateWithOkFreeFunktionByMoveIsSuccessful) +TEST_F(expected_test, CreateWithOkFreeFunctionByMoveIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "b1320e1f-3613-4085-8125-fc95d584681c"); constexpr int A{44}; @@ -353,7 +353,7 @@ TEST_F(expected_test, CreateWithOkFreeFunktionByMoveIsSuccessful) EXPECT_THAT(sut.value().m_b, Eq(B)); } -TEST_F(expected_test, CreateWithOkFreeFunktionByForwardingIsSuccessful) +TEST_F(expected_test, CreateWithOkFreeFunctionByForwardingIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "a3d41181-f4ad-4431-9441-7dfaeb8d6f7f"); constexpr int A{44}; @@ -364,7 +364,7 @@ TEST_F(expected_test, CreateWithOkFreeFunktionByForwardingIsSuccessful) EXPECT_THAT(sut.value().m_b, Eq(B)); } -TEST_F(expected_test, CreateWithErrFreeFunktionByCopyIsSuccessful) +TEST_F(expected_test, CreateWithErrFreeFunctionByCopyIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "bb641919-e319-4e9c-af67-e1e8d5dab682"); constexpr TestError ERROR = TestError::ERROR1; @@ -373,7 +373,7 @@ TEST_F(expected_test, CreateWithErrFreeFunktionByCopyIsSuccessful) EXPECT_THAT(sut.get_error(), Eq(ERROR)); } -TEST_F(expected_test, CreateWithErrFreeFunktionByMoveIsSuccessful) +TEST_F(expected_test, CreateWithErrFreeFunctionByMoveIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "f99af97a-16b2-41e6-a808-2d58bfe0fc57"); constexpr int A{666}; @@ -385,7 +385,7 @@ TEST_F(expected_test, CreateWithErrFreeFunktionByMoveIsSuccessful) EXPECT_THAT(sut.get_error().m_b, Eq(B)); } -TEST_F(expected_test, CreateWithErrFreeFunktionByForwardingIsSuccessful) +TEST_F(expected_test, CreateWithErrFreeFunctionByForwardingIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "08411afa-e1d3-4a28-9680-f89796f86340"); constexpr int A{44}; diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl b/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl index 28306182b0e..e351f8d754a 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl @@ -46,15 +46,15 @@ detail::ok ok(Targs&&... args) } template -detail::err err(const T& value) +detail::err err(const T& error) { - return detail::err{value}; + return detail::err{error}; } template -detail::err err(T&& value) +detail::err err(T&& error) { - return detail::err{std::forward(value)}; + return detail::err{std::forward(error)}; } template diff --git a/iceoryx_hoofs/vocabulary/include/iox/expected.hpp b/iceoryx_hoofs/vocabulary/include/iox/expected.hpp index e0389d235d5..1d5f14a7603 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/expected.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/expected.hpp @@ -33,7 +33,7 @@ template using error = detail::err; /// @brief convenience function to create an 'expected' with a 'void' value type -/// @param T helper template parameter for SFINEA +/// @tparam T helper template parameter for SFINEA /// @code /// expected callMe() { /// //... @@ -44,7 +44,8 @@ template > detail::ok ok(); /// @brief convenience function to create an 'expected' with a value type by copy -/// @param T value type for the 'expected' +/// @tparam T value type for the 'expected' +/// @param[in] value is the value for the 'expected' /// @code /// expected callMe() { /// //... @@ -55,7 +56,8 @@ template > detail::ok ok(const T& value); /// @brief convenience function to create an 'expected' with a value type by move -/// @param T value type for the 'expected' +/// @tparam T value type for the 'expected' +/// @param[in] value is the value for the 'expected' /// @code /// expected callMe() { /// //... @@ -68,7 +70,9 @@ template , typename = enable_if_n detail::ok ok(T&& value); /// @brief convenience function to create an 'expected' with a value type by argument forwarding -/// @param T value type for the 'expected' +/// @tparam T value type for the 'expected' +/// @tparam Targs types for the constructor of the value type +/// @param[in] args... arguments which will be perfectly forwarded to the value type constructor /// @code /// expected callMe() { /// //... @@ -79,7 +83,8 @@ template > detail::ok ok(Targs&&... args); /// @brief convenience function to create an 'expected' with an error type by copy -/// @param T error type for the 'expected' +/// @tparam T error type for the 'expected' +/// @param[in] error is the error for the 'expected' /// @code /// expected callMe() { /// //... @@ -87,10 +92,11 @@ detail::ok ok(Targs&&... args); /// } /// @endcode template -detail::err err(const T& value); +detail::err err(const T& error); /// @brief convenience function to create an 'expected' with an error type by move -/// @param T error type for the 'expected' +/// @tparam T error type for the 'expected' +/// @param[in] error is the error for the 'expected' /// @code /// expected callMe() { /// //... @@ -100,10 +106,12 @@ detail::err err(const T& value); /// } /// @endcode template > -detail::err err(T&& value); +detail::err err(T&& error); /// @brief convenience function to create an 'expected' with an error type by argument forwarding -/// @param T error type for the 'expected' +/// @tparam T error type for the 'expected' +/// @tparam Targs types for the constructor of the error type +/// @param[in] args... arguments which will be perfectly forwarded to the error type constructor /// @code /// expected callMe() { /// //...