Horizon
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ranges::index_fn Struct Reference

Checked indexed range access. More...

#include <operations.hpp>

Public Member Functions

 template (typename Rng, typename Int)(AND integral< Int > AND borrowed_range< Rng >) const expr range_reference_t< Rng > operator()(Rng &&rng
 
 RANGES_EXPECT (0<=static_cast< D >(n))
 
 RANGES_EXPECT (!(bool) sized_range< Rng >||static_cast< D >(n)< ranges::distance(rng))
 
return ranges::begin (rng)[static_cast< D >(n)]
 

Public Attributes

Int n const
 

Detailed Description

Checked indexed range access.

See also
at_fn Unchecked indexed range access.

Member Function Documentation

◆ template()

ranges::index_fn::template ( typename Rng  ,
typename Int   
) const &&
Returns
begin(rng)[n]

Member Data Documentation

◆ const

Int n ranges::index_fn::const
Initial value:
{
using D = range_difference_t<Rng>

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