lsst.sphgeom g04536d8304+b0138be388
 
Loading...
Searching...
No Matches
lsst::sphgeom::RangeSet::Iterator Struct Reference

#include <RangeSet.h>

Public Types

using difference_type = ptrdiff_t
 
using value_type = std::tuple<std::uint64_t, std::uint64_t>
 
using pointer = void
 
using reference = std::tuple<std::uint64_t, std::uint64_t>
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

 Iterator (std::uint64_t const *ptr)
 
Iteratoroperator++ ()
 
Iteratoroperator-- ()
 
Iterator operator++ (int)
 
Iterator operator-- (int)
 
Iterator operator+ (ptrdiff_t n) const
 
Iterator operator- (ptrdiff_t n) const
 
Iteratoroperator+= (ptrdiff_t n)
 
Iteratoroperator-= (ptrdiff_t n)
 
ptrdiff_t operator- (Iterator const &i) const
 
bool operator== (Iterator const &i) const
 
bool operator!= (Iterator const &i) const
 
bool operator< (Iterator const &i) const
 
bool operator> (Iterator const &i) const
 
bool operator<= (Iterator const &i) const
 
bool operator>= (Iterator const &i) const
 
std::tuple< std::uint64_t, std::uint64_t > operator* ()
 
std::tuple< std::uint64_t, std::uint64_t > operator[] (ptrdiff_t n) const
 

Public Attributes

std::uint64_t const * p = nullptr
 

Friends

void swap (Iterator &a, Iterator &b)
 
Iterator operator+ (ptrdiff_t n, Iterator const &i)
 

Detailed Description

A constant iterator over the ranges (represented as 2-tuples) in a RangeSet.

RangeSet does not store an array of 2-tuples internally. But, ยง24.2.5 of the C++11 standard requires the following from constant forward iterators:

  • (1.3) The reference type of the iterator must be a reference to const value_type
  • (6) If a and b are both dereferenceable, then a == b if and only if *a and *b are bound to the same object.

So, dereferencing a forward iterator cannot return by value, or return a reference to a member of the iterator itself. As a result, it seems impossible to provide more than an input iterator for container objects that do not store their values directly.

While this class only claims to be an input iterator, it nevertheless implements most random access iterator requirements. Dereferencing an iterator returns a tuple by value, and operator-> is omitted.


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