13#ifndef CXXUTILS_RANGE_WITH_AT_H
14#define CXXUTILS_RANGE_WITH_AT_H
39 decltype(
auto)
at (
size_t i)
41 if (i >= std::size(*
this))
43 return this->operator[] (i);
47 decltype(
auto)
at (
size_t i)
const
49 if (i >= std::size(*
this))
51 return this->operator[] (i);
57template <std::ranges::input_range SPAN,
class XFORM>
Add at() methods to a range class.
decltype(auto) at(size_t i)
auto end(range_with_at< T > &s)
range_with_at< std::ranges::transform_view< SPAN, XFORM > > transform_view_with_at
Helper to add at() methods to a transform_view.
void throw_out_of_range(const std::string &what, size_t index, size_t size, const void *obj)
Throw an out_of_range exception.
auto begin(range_with_at< T > &s)
Helpers for throwing out_of_range exceptions.