Skip to main content

array_operand Struct Template

An array operand of a comparator, other than a character array. More...

Declaration​

template <class T>
struct micro_os_plus::micro_test_plus::detail::array_operand<T> { ... }

Included Headers​

Public Constructors Index​

template <class T>
constexprarray_operand (const T *first, std::size_t count) noexcept

Constructs the operand from the first element and the size of an array. More...

Public Member Functions Index​

template <class T>
constexpr const T *begin (void) const noexcept

Returns an iterator to the first element. More...

template <class T>
constexpr const T *end (void) const noexcept

Returns an iterator past the last element. More...

Private Member Attributes Index​

template <class T>
std::size_tcount_

The number of elements. More...

template <class T>
const T *first_

The first element. More...

Description​

An array operand of a comparator, other than a character array.

The comparators convert the arrays of any element type except the character types (the byte buffers and the arrays of numbers) to this type (see as_operand()), so that they are compared element by element, and written as ranges, instead of being compared and written as the addresses they decay to. Two arrays of different sizes are never equal, and the elements are compared with equal_to::apply(), so integers of different signedness are compared by value.

The elements are not copied; the operand must outlive the comparison, which is always the case within a check.

Template Parameters
T

The element type, possibly const.

Definition at line 1845 of file detail.h.

Public Constructors​

array_operand()​

template <class T>
micro_os_plus::micro_test_plus::detail::array_operand< T >::array_operand (const T * first, std::size_t count)
constexpr noexcept

Constructs the operand from the first element and the size of an array.

Parameters
first

The first element of the array.

count

The number of elements of the array.

Stores the pointer and the count; nothing is copied.

Declaration at line 1854 of file detail.h, definition at line 1627 of file detail-inlines.h.

1627 template <class T>
1628 constexpr array_operand<T>::array_operand (const T* first,
1629 std::size_t count) noexcept
1630 : first_{ first }, count_{ count }
1631 {

Reference micro_os_plus::micro_test_plus::detail::array_operand< T >::first_.

Public Member Functions​

begin()​

template <class T>
const T * micro_os_plus::micro_test_plus::detail::array_operand< T >::begin (void)
nodiscard constexpr noexcept

Returns an iterator to the first element.

Parameters

None.

Returns

A pointer to the first element.

Returns the stored pointer.

Declaration at line 1864 of file detail.h, definition at line 1639 of file detail-inlines.h.

1639 constexpr const T*
1640 array_operand<T>::begin (void) const noexcept
1641 {
1642 return first_;

Reference micro_os_plus::micro_test_plus::detail::array_operand< T >::first_.

Referenced by micro_os_plus::micro_test_plus::detail::operator<=> and micro_os_plus::micro_test_plus::detail::operator==.

end()​

template <class T>
const T * micro_os_plus::micro_test_plus::detail::array_operand< T >::end (void)
nodiscard constexpr noexcept

Returns an iterator past the last element.

Parameters

None.

Returns

A pointer past the last element.

Returns the pointer past the last element.

Declaration at line 1874 of file detail.h, definition at line 1658 of file detail-inlines.h.

1658 constexpr const T*
1659 array_operand<T>::end (void) const noexcept
1660 {
1661 return first_ + count_;

References micro_os_plus::micro_test_plus::detail::array_operand< T >::count_ and micro_os_plus::micro_test_plus::detail::array_operand< T >::first_.

Referenced by micro_os_plus::micro_test_plus::detail::operator<=> and micro_os_plus::micro_test_plus::detail::operator==.

Private Member Attributes​

count_​

template <class T>
std::size_t micro_os_plus::micro_test_plus::detail::array_operand< T >::count_

The number of elements.

The extent of the array passed to the comparator.

Definition at line 1891 of file detail.h.

1891 std::size_t count_;

Referenced by micro_os_plus::micro_test_plus::detail::array_operand< T >::end.

first_​

template <class T>
const T* micro_os_plus::micro_test_plus::detail::array_operand< T >::first_

The documentation for this struct was generated from the following files:


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.