Ranges Library

Ranges Library#

2026-10-07

1 min read time

Applies to Linux and Windows

This page documents the ranges and iterator library headers available in libhipcxx, covering forward, bidirectional, random-access, and contiguous range concepts.

See the documentation of the standard headers <iterator> and <ranges>

Header

Content

Availability

<cuda/std/iterator>

Iterator related concepts and machinery such as cuda::std::forward_iterator

libhipcxx 2.7

<cuda/std/ranges>

Range related concepts and machinery such as cuda::std::ranges::forward_range and cuda::std::ranges::subrange

libhipcxx 2.7

Extensions#

All library features are available from C++17 onwards. The concepts can be used like type traits prior to C++20.

template<cuda::std::contiguos_range Range>
void do_something_with_ranges_in_cpp20(Range&& range) {...}

template<class Range, cuda::std::enable_if_t<cuda::std::contiguos_range<Range>, int> = 0>
void do_something_with_ranges_in_cpp17(Range&& range) {...}

Restrictions#

  • Subsumption does not work prior to C++20.

Omissions#

  • Range-based algorithms have not been implemented.

  • Views have not been implemented.