Class TreeIndex

Class Documentation

class TreeIndex

Represents an index (position) into a tree structure

Note

Using this to select a subexpression from an expression tree takes O(N) time where N = depth()

Public Functions

TreeIndex() = default
TreeIndex(container::svector<std::size_t> positions)
TreeIndex(std::initializer_list<std::size_t> positions)
template<std::ranges::range Positions>
inline TreeIndex(Positions &&positions)
ExprPtr &select_from(ExprPtr &expr) const
const ExprPtr &select_from(const ExprPtr &expr) const
Expr &select_from(Expr &expr) const
const Expr &select_from(const Expr &expr) const
std::size_t depth() const
bool operator==(const TreeIndex&) const = default
std::strong_ordering operator<=>(const TreeIndex&) const = default

Friends

template<typename CharT>
inline friend std::basic_ostream<CharT> &operator<<(std::basic_ostream<CharT> &stream, const TreeIndex &idx)