Ruby 4.1.0dev (2026-10-21 revision 536dc6f98b72e6999a84bb6373562c43cb1ddf8a)
Public Member Functions
prism::node_range Class Reference

The nodes in a list, usable in a range-based for loop. More...

#include <node.hpp>

Public Member Functions

 node_range (const pm_node_list_t &list PRISM_LIFETIMEBOUND) noexcept
 Create a range over the nodes in the given list.
 
pm_node_t *const * begin () const noexcept
 A pointer to the first node.
 
pm_node_t *const * end () const noexcept
 A pointer one past the last node.
 
std::size_t size () const noexcept
 The number of nodes.
 
bool empty () const noexcept
 Whether there are no nodes.
 

Detailed Description

The nodes in a list, usable in a range-based for loop.

It refers to the list rather than copying it, so the list must outlive it.

Definition at line 127 of file node.hpp.

Constructor & Destructor Documentation

◆ node_range()

prism::node_range::node_range ( const pm_node_list_t &list  PRISM_LIFETIMEBOUND)
inlineexplicitnoexcept

Create a range over the nodes in the given list.

Parameters
listThe list of nodes to create a range for.

Definition at line 134 of file node.hpp.

Member Function Documentation

◆ begin()

pm_node_t *const * prism::node_range::begin ( ) const
inlinenoexcept

A pointer to the first node.

Returns
A pointer to the first node, or null if the list is empty.

Definition at line 141 of file node.hpp.

◆ empty()

bool prism::node_range::empty ( ) const
inlinenoexcept

Whether there are no nodes.

Returns
True if there are no nodes, false otherwise.

Definition at line 162 of file node.hpp.

◆ end()

pm_node_t *const * prism::node_range::end ( ) const
inlinenoexcept

A pointer one past the last node.

Returns
A pointer one past the last node, or null if the list is empty.

Definition at line 148 of file node.hpp.

◆ size()

std::size_t prism::node_range::size ( ) const
inlinenoexcept

The number of nodes.

Returns
The number of nodes.

Definition at line 155 of file node.hpp.


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