Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

Container Functions

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

Functions

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

◆ 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 212 of file basic.h.