WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
iterator_range.hpp File Reference

This provides a very simple, boring adaptor for a begin and end iterator into a range type. More...

#include "wpi/util/ADL.hpp"
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

struct  wpi::util::explicitly_convertible< From, To, typename >
struct  wpi::util::explicitly_convertible< From, To, std::void_t< decltype(static_cast< To >(std::declval< std::add_rvalue_reference_t< From > >()))> >
class  wpi::util::iterator_range< IteratorT >
 A range adaptor for a pair of iterators. More...

Namespaces

namespace  wpi
namespace  wpi::util

Functions

template<typename Container>
 wpi::util::iterator_range (Container &&) -> iterator_range< wpi::util::detail::IterOfRange< Container > >
template<class T>
iterator_range< T > wpi::util::make_range (T x, T y)
 Convenience function for iterating over sub-ranges.
template<typename T>
iterator_range< T > wpi::util::make_range (std::pair< T, T > p)

Detailed Description

This provides a very simple, boring adaptor for a begin and end iterator into a range type.

This should be used to build range views that work well with range based for loops and range based constructors.

Note that code here follows more standards-based coding conventions as it is mirroring proposed interfaces for standardization.