108 template <
typename TIter>
116 template <std::
size_t TN>
124 template <std::
size_t TN>
132 template <
typename TIter>
135 len_(
static_cast<std::size_t
>(std::distance(first, last)))
147 template <
std::
size_t TN>
156 template <std::
size_t TN>
179 return begin() + len_;
191 return std::reverse_iterator<const_iterator>(
end());
203 return std::reverse_iterator<const_iterator>(
begin());
237 return data_[len_ - 1U];
254 constexpr bool empty() const noexcept
263 std::advance(data_, n);
277 std::swap(data_, other.data_);
278 std::swap(len_, other.len_);
292 return std::lexicographical_compare(view1.begin(), view1.end(), view2.begin(), view2.end());
300 return !(view2 < view1);
308 return (view2 < view1);
316 return !(view1 < view2);
325 (view1.size() == view2.size()) &&
326 std::equal(view1.begin(), view1.end(), view2.begin());
334 return !(view1 == view2);
This file contains classes required for generic custom assertion functionality.
#define COMMS_ASSERT(expr)
Generic assert macro.
Definition Assert.h:170
Describes an object that can refer to a constant contiguous sequence of other objects.
Definition ArrayView.h:31
const_iterator ConstIterator
Same as const_iterator.
Definition ArrayView.h:74
~ArrayView() noexcept=default
Destructor.
const_reference at(size_type pos) const
Element access with range check.
Definition ArrayView.h:220
bool operator!=(const ArrayView< T > &view1, const ArrayView< T > &view2) noexcept
Inequality compare between the views.
Definition ArrayView.h:332
constexpr const_iterator begin() const noexcept
Iterator to begining of the sequence.
Definition ArrayView.h:165
pointer Pointer
Same as pointer.
Definition ArrayView.h:43
reverse_iterator ReverseIterator
Same as reverse_iterator.
Definition ArrayView.h:92
void remove_prefix(size_type n)
Narrow the view by skipping number of elements at the beginning.
Definition ArrayView.h:261
bool operator<(const ArrayView< T > &view1, const ArrayView< T > &view2) noexcept
Lexicographical compare between the views.
Definition ArrayView.h:290
bool operator<=(const ArrayView< T > &view1, const ArrayView< T > &view2) noexcept
Lexicographical compare between the views.
Definition ArrayView.h:298
ArrayView & operator=(T(&data)[TN])
Assign array of elements with known size.
Definition ArrayView.h:157
const_reverse_iterator crend() const noexcept
Reverse iterator to the beginning of the sequence.
Definition ArrayView.h:207
const_iterator iterator
Same as const_iterator.
Definition ArrayView.h:77
constexpr const_iterator end() const noexcept
Iterator to the end of the sequence.
Definition ArrayView.h:177
ArrayView() noexcept=default
Default constructor.
value_type ValueType
Same as value_type.
Definition ArrayView.h:37
bool operator>=(const ArrayView< T > &view1, const ArrayView< T > &view2) noexcept
Lexicographical compare between the views.
Definition ArrayView.h:314
constexpr size_type size() const noexcept
Get number of element in the view.
Definition ArrayView.h:241
std::reverse_iterator< const_iterator > const_reverse_iterator
Same as std::reverse_iterator<const_iterator>
Definition ArrayView.h:83
iterator Iterator
Same as iterator.
Definition ArrayView.h:80
std::size_t size_type
Equal to std::size_t.
Definition ArrayView.h:64
T * pointer
Pointer to the single element (T*)
Definition ArrayView.h:40
reverse_iterator rend() const noexcept
Reverse iterator to the beginning of the sequence.
Definition ArrayView.h:201
void remove_suffix(size_type n)
Narrow the view by dropping number of elements at the end.
Definition ArrayView.h:269
constexpr const_reference operator[](size_type pos) const
Element access operator.
Definition ArrayView.h:213
ArrayView(TIter iter, size_type len) noexcept
Constructor.
Definition ArrayView.h:109
const_reverse_iterator ConstReverseIterator
Same as const_reverse_iterator.
Definition ArrayView.h:86
reference Reference
Same as reference.
Definition ArrayView.h:55
bool operator>(const ArrayView< T > &view1, const ArrayView< T > &view2) noexcept
Lexicographical compare between the views.
Definition ArrayView.h:306
constexpr size_type length() const noexcept
Same as ref size()
Definition ArrayView.h:247
const_reference ConstReference
Same as const_reference.
Definition ArrayView.h:61
constexpr bool empty() const noexcept
Check the view is empty.
Definition ArrayView.h:254
ArrayView(const T(&data)[TN]) noexcept
Construct out of array of elements with known size.
Definition ArrayView.h:117
constexpr const_iterator cend() const noexcept
Iterator to the end of the sequence.
Definition ArrayView.h:183
bool operator==(const ArrayView< T > &view1, const ArrayView< T > &view2) noexcept
Equality compare between the views.
Definition ArrayView.h:322
void swap(ArrayView &other) noexcept
Swap contents of two views.
Definition ArrayView.h:275
const_reverse_iterator reverse_iterator
Same as const_reverse_iterator.
Definition ArrayView.h:89
size_type SizeType
Same as size_type;.
Definition ArrayView.h:67
const_pointer const_iterator
Implementation defined constant RandomAccessIterator and ContiguousIterator whose value_type is T.
Definition ArrayView.h:71
const_pointer ConstPointer
Same as const_pointer.
Definition ArrayView.h:49
ArrayView(TIter first, TIter last) noexcept
Construct out of iterators rande.
Definition ArrayView.h:133
T & reference
Reference to an element (T&)
Definition ArrayView.h:52
ArrayView(T(&data)[TN]) noexcept
Construct out of array of elements with known size.
Definition ArrayView.h:125
T value_type
Type of the single element.
Definition ArrayView.h:34
constexpr const_iterator cbegin() const noexcept
Iterator to begining of the sequence.
Definition ArrayView.h:171
const_reverse_iterator crbegin() const noexcept
Reverse iterator to the end of the sequence.
Definition ArrayView.h:195
const T & const_reference
Reference to a const element (const T&)
Definition ArrayView.h:58
const_reverse_iterator rbegin() const noexcept
Reverse iterator to the end of the sequence.
Definition ArrayView.h:189
const T * const_pointer
Pointer to the constant element (const T*)
Definition ArrayView.h:46
constexpr const_reference front() const
Access the first element.
Definition ArrayView.h:228
constexpr const_reference back() const
Access the last element.
Definition ArrayView.h:235
Main namespace for all classes / functions of COMMS library.