Spicy
Public Types | Public Member Functions | List of all members
hilti::node::Range< T > Class Template Reference

#include <node.h>

Public Types

using iterator = RangeIterator< T >
 
using const_iterator = RangeIterator< T >
 

Public Member Functions

 Range (std::vector< Node >::const_iterator begin, std::vector< Node >::const_iterator end)
 
 Range (const std::vector< Node > &nodes)
 
 Range (const Range &other)=default
 
 Range (Range &&other) noexcept=default
 
auto begin () const
 
auto end () const
 
size_t size () const
 
const T & front () const
 
bool empty () const
 
std::vector< T > copy () const
 
const T & operator[] (size_t i) const
 
bool operator== (const Range &other) const
 
Rangeoperator= (const Range &other)=default
 
Rangeoperator= (Range &&other) noexcept=default
 

Detailed Description

template<typename T>
class hilti::node::Range< T >

A range of AST nodes, defined by start and end into an existing vector of nodes. The range creates a view that can be iterated over, yielding a reference to each node in turn.

Member Function Documentation

◆ copy()

template<typename T>
std::vector<T> hilti::node::Range< T >::copy ( ) const
inline

Returns a new vector containing copies of all nodes that the range includes.


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