Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Container Functions

Provides some commonly useful functions for general containers. More...

Classes

class  ogdf::Reverse< T >
 A wrapper class to easily iterate through a container in reverse. More...
 

Functions

template<typename T >
Reverse< T > ogdf::reverse (T &container)
 Provides iterators for container to make it easily iterable in reverse. More...
 
template<typename CONTAINER , typename T >
int ogdf::searchPos (const CONTAINER &C, const T &x)
 Searches for the position of x in container C; returns -1 if not found. More...
 

Detailed Description

Provides some commonly useful functions for general containers.

Function Documentation

◆ reverse()

template<typename T >
Reverse<T> ogdf::reverse ( T &  container)

Provides iterators for container to make it easily iterable in reverse.

for (auto elem : reverse(container)) { ... }
Template Parameters
Tdenotes the type of container.
Parameters
containeris the container to be reversed.

Definition at line 74 of file Reverse.h.

◆ searchPos()

template<typename CONTAINER , typename T >
int ogdf::searchPos ( const CONTAINER &  C,
const T &  x 
)

Searches for the position of x in container C; returns -1 if not found.

Positions are number 0, 1, 2, ... The function uses the equality operator for comparing elements.

Parameters
Cis a container.
xis the element to search for.
Template Parameters
Tis the type of the elements in C.
Returns
the position of the first occurrence of x in C (positions start with 0), or -1 if x is not in C.

Definition at line 236 of file basic.h.

ogdf::reverse
Reverse< T > reverse(T &container)
Provides iterators for container to make it easily iterable in reverse.
Definition: Reverse.h:74