ATLAS Offline Software
Public Member Functions | List of all members
CxxUtils::range_with_at< RANGE > Class Template Reference

Add at() methods to a range class. More...

#include <range_with_at.h>

Inheritance diagram for CxxUtils::range_with_at< RANGE >:
Collaboration diagram for CxxUtils::range_with_at< RANGE >:

Public Member Functions

decltype(auto) at (size_t i)
 
decltype(auto) at (size_t i) const
 

Detailed Description

template<class RANGE>
class CxxUtils::range_with_at< RANGE >

Add at() methods to a range class.

Many standard range objects allow operator[] but do not implement at(). Use this to add at() methods to a random_access_range class.

Definition at line 31 of file range_with_at.h.

Member Function Documentation

◆ at() [1/2]

template<class RANGE >
decltype(auto) CxxUtils::range_with_at< RANGE >::at ( size_t  i)
inline

Definition at line 38 of file range_with_at.h.

39  {
40  if (i >= std::size(*this))
41  throw std::out_of_range ("CxxUtils::range_with_at");
42  return this->operator[] (i);
43  }

◆ at() [2/2]

template<class RANGE >
decltype(auto) CxxUtils::range_with_at< RANGE >::at ( size_t  i) const
inline

Definition at line 46 of file range_with_at.h.

47  {
48  if (i >= std::size(*this))
49  throw std::out_of_range ("CxxUtils::range_with_at");
50  return this->operator[] (i);
51  }

The documentation for this class was generated from the following file:
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:85