UtilityΒΆ

const auto at

Return the element at a specific position in a range.

This is roughly equivalent to first (drop (range, position)), and is only available if that is available.

See
at_c
Parameters
  • range -

    The range within which the element is sought.

  • position -

    The position of the desired element.

  • direction -

    (optional) The direction of traversal.

template <std::size_t Position, class Range, class Direction>
auto at_c(Range && range, Direction const & direction)

Return the element at a specific index in a range.

The first template parameter (the index) must be given explicitly. This is roughly equivalent to at (range, rime::size_t<Index>()).

Templates
  • Position -

    The position of the desired element.

Parameters
  • range -

    The range within which the element is sought.

  • direction -

    (optional) The direction of traversal.

const auto second

Return the element at the ... position in a range. This is equivalent to first (drop (direction, view_once (range))). It is also available for ranges that implement drop only with an increment of one.

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto third

Return the element at the ... position in a range. This is equivalent to at_c<2> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto fourth

Return the element at the ... position in a range. This is equivalent to at_c<3> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto fifth

Return the element at the ... position in a range. This is equivalent to at_c<4> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto sixth

Return the element at the ... position in a range. This is equivalent to at_c<5> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto seventh

Return the element at the ... position in a range. This is equivalent to at_c<6> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto eighth

Return the element at the ... position in a range. This is equivalent to at_c<7> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto ninth

Return the element at the ... position in a range. This is equivalent to at_c<8> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto tenth

Return the element at the ... position in a range. This is equivalent to at_c<9> (...).

Parameters
  • direction -

    (optional) The direction from which to count.

  • range -

    The range from which the element is taken.

const auto walk_size

Computes the number of elements in a range.

If the range has a size() operation, that is used. If not, then the drop() operation is used until the range is empty, and the number of steps is counted.

Parameters
  • range -

    The range to count the number of elements of.

  • direction -

    The direction to traverse the range in.

Previous topic

Intrinsic operations

Next topic

Queries

This Page