Skip to content

Commit

Permalink
Merge pull request #2223 from gmandhyan/iox-2220-add-stl-like-contain…
Browse files Browse the repository at this point in the history
…er-type-aliases

iox-#2220 Add missing type aliases for STL like containers
  • Loading branch information
elfenpiff authored Mar 12, 2024
2 parents 19184d4 + 286b394 commit 377bf0b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
- Race condition in `PoshRuntime` during shutdown [#2192](https://github.com/eclipse-iceoryx/iceoryx/issues/2192)
- Fix wrong memory orders in SpscFiFo [#2167](https://github.com/eclipse-iceoryx/iceoryx/issues/2167)
- Implement missing copy assignment for expected [#2216](https://github.com/eclipse-iceoryx/iceoryx/issues/2216)
- Add missing type aliases that conform with STL container types [#2220](https://github.com/eclipse-iceoryx/iceoryx/issues/2220)

**Refactoring:**

Expand Down
5 changes: 5 additions & 0 deletions iceoryx_hoofs/container/include/iox/forward_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "iox/assertions.hpp"
#include "iox/uninitialized_array.hpp"

#include <cstddef>
#include <cstdint>
#include <iostream>

Expand Down Expand Up @@ -65,7 +66,11 @@ class forward_list
using iterator = IteratorBase<false>;
using const_iterator = IteratorBase<true>;
using value_type = T;
using reference = T&;
using const_reference = const T&;
using difference_type = std::ptrdiff_t;
using size_type = decltype(Capacity);
using index_type = size_type;

/// @brief constructor for an empty list (of T-types elements)
forward_list() noexcept;
Expand Down
5 changes: 5 additions & 0 deletions iceoryx_hoofs/container/include/iox/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "iox/assertions.hpp"
#include "iox/uninitialized_array.hpp"

#include <cstddef>
#include <cstdint>
#include <iostream>

Expand Down Expand Up @@ -66,7 +67,11 @@ class list
using iterator = IteratorBase<false>;
using const_iterator = IteratorBase<true>;
using value_type = T;
using reference = T&;
using const_reference = const T&;
using difference_type = std::ptrdiff_t;
using size_type = decltype(Capacity);
using index_type = size_type;

/// @brief constructor for an empty list (of T-types elements)
list() noexcept;
Expand Down
6 changes: 6 additions & 0 deletions iceoryx_hoofs/container/include/iox/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "iox/uninitialized_array.hpp"

#include <algorithm>
#include <cstddef>
#include <cstdint>

namespace iox
Expand All @@ -40,7 +41,12 @@ class vector final
public:
using value_type = T;
using iterator = T*;
using reference = T&;
using const_iterator = const T*;
using const_reference = const T&;
using difference_type = std::ptrdiff_t;
using size_type = decltype(Capacity);
using index_type = size_type;

/// @brief creates an empty vector
vector() noexcept = default;
Expand Down
5 changes: 5 additions & 0 deletions iceoryx_hoofs/vocabulary/include/iox/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <limits>
Expand Down Expand Up @@ -224,6 +225,10 @@ class span final : public detail::span_storage<Extent>
using reference = T&;
using iterator = span_iterator<T>;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_iterator = const T*;
using const_reference = const T&;
using size_type = decltype(Extent);
using index_type = size_type;
static constexpr uint64_t extent = Extent;

// constructors, copy, assignment, and destructor
Expand Down

0 comments on commit 377bf0b

Please sign in to comment.