Skip to content

Commit

Permalink
Added iterators constructor to std::util::ArrayView.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Dec 3, 2024
1 parent 9d9cd7f commit cdd0883
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/comms/util/ArrayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ class ArrayView
{
}

/// @brief Construct out of iterators rande
template <typename TIter>
ArrayView(TIter first, TIter last) noexcept
: data_(reinterpret_cast<const_pointer>(&(*first))),
len_(static_cast<std::size_t>(std::distance(first, last)))
{
COMMS_ASSERT(0 <= std::distance(first, last));
}

/// @brief Destructor
~ArrayView() noexcept = default;

Expand Down

0 comments on commit cdd0883

Please sign in to comment.