Skip to content

Commit

Permalink
iox-#1391 Address review findings by removing unnecessary namespace a…
Browse files Browse the repository at this point in the history
…nd add implicit includes

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Jan 11, 2023
1 parent 91b1244 commit eb861cc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
4 changes: 2 additions & 2 deletions iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ TEST_F(expected_test, ExpectedWithValueConvertsToOptionalWithValue)
::testing::Test::RecordProperty("TEST_ID", "a877f9bd-5793-437f-8dee-a109aed9f647");
constexpr int VALUE = 4711;
expected<int, TestError> sut{success<int>(VALUE)};
iox::optional<int> value = sut.to_optional();
optional<int> value = sut.to_optional();

ASSERT_THAT(value.has_value(), Eq(true));
EXPECT_THAT(*value, Eq(VALUE));
Expand All @@ -556,7 +556,7 @@ TEST_F(expected_test, ExpectedWithErrorConvertsToOptionalWithoutValue)
{
::testing::Test::RecordProperty("TEST_ID", "fe161275-8fa2-43c9-86e7-0a20d79eb44f");
expected<int, TestError> sut{error<TestError>(TestError::ERROR1)};
iox::optional<int> value = sut.to_optional();
optional<int> value = sut.to_optional();

ASSERT_THAT(value.has_value(), Eq(false));
}
Expand Down
12 changes: 0 additions & 12 deletions iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ namespace iox
{
// AXIVION Next Construct AutosarC++19_03-A12.1.5 : This is a false positive since there is no fitting constructor
// available for delegation
namespace internal
{
template <typename... T>
struct IsOptional : std::false_type
{
};
template <typename T>
struct IsOptional<iox::optional<T>> : std::true_type
{
};
} // namespace internal

template <typename T>
inline success<T>::success(const T& t) noexcept
: value(t)
Expand Down
7 changes: 0 additions & 7 deletions iceoryx_hoofs/vocabulary/include/iox/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@

namespace iox
{
namespace internal
{
/// @brief Type trait which verifies whether the passed type T is of type optional
template <typename...>
struct IsOptional;
} // namespace internal

/// @brief helper struct to create an expected which is signalling success more easily
/// @param T type which the success helper class should contain
/// @code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "iceoryx_hoofs/log/logstream.hpp"
#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "iox/expected.hpp"
#include "iox/optional.hpp"
#include "iox/string.hpp"

#include <cstdint>
Expand Down

0 comments on commit eb861cc

Please sign in to comment.