Compile-time queriesΒΆ

template <class Range>
struct range::is_range

Evaluate to true if Range is a range type.

template <class Range, class... Directions>
struct range::is_view

Metafunction that returns true iff Range is a view.

That is, view (range, directions...) returns range itself.

Templates
  • Range -

    The range.

  • Directions -

    Zero or more directions. If no directions are given, the range’s default direction is used.

template <class Range, class Direction>
struct range::always_empty

Evaluate to true iff the range is known at compile time to be empty. This happens when empty (range, direction) returns a compile-time constant with value true.

If this evaluates to false, it is still possible for the range to be empty at run time.

template <class Range, class Direction>
struct range::never_empty

Evaluate to true iff the range is known at compile time to be not empty. This happens when empty (range, direction) returns a compile-time constant with value false.

If this evaluates to false, it is still possible for the range to be non-empty at run time.

template <class Range, class Direction = decltype ( callable::default_direction() (std::declval <Range>()))>
struct range::is_homogeneous

Metafunction that returns true iff drop (range, direction) returns a Range, or if chop (range, direction) is implemented.

This means, for example, that a recursive iteration can be written as a loop. Since applying “drop” with an increment is equivalent to applying “drop” a number of times, a homogeneous range cannot become heterogeneous.

Parameters
  • Range -

    The range to check for homogeneousness. Qualifications are ignored.

  • Direction -

    (optional) The direction. If left out, the default direction is used.

template <class Range>
struct range::element_types

Meta-range with the types that traversing over Range result in. If the range is homogeneous, this has infinite length. The direction that this range is traversed in should be the direction of interest of the underlying range. The default direction is that of the underlying range.

view_once() is called on the range first. The resulting types will often be reference types. For example, this is the case when Range is a container.

Previous topic

Queries

Next topic

Existing ranges

This Page