\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0 - Handles and Circulators
CGAL::Circulator_traits< C > Struct Template Reference

#include <CGAL/circulator.h>

Definition

The circulator traits class distinguishes between circulators and iterators.

It defines a local type category that is identical to the type Circulator_tag if the iterator category of the argument C is a circulator category. Otherwise it is identical to the type Iterator_tag.

The local type iterator_category gives the corresponding iterator category for circulators, i.e. one of forward_iterator_tag, bidirectional_iterator_tag, or random_access_iterator_tag.

The local type circulator_category gives the corresponding circulator category for iterators, i.e. one of Forward_circulator_tag, Bidirectional_circulator_tag, or Random_access_circulator_tag.

Example

A generic function bar() that distinguishes between a call with a circulator range and a call with an iterator range:

template <class I>
void bar( I i, I j, CGAL::Iterator_tag) {
// This function is called for iterator ranges [i,j).
}
template <class C>
void bar( C c, C d, CGAL::Circulator_tag) {
// This function is called for circulator ranges [c,d).
}
template <class IC>
void bar( IC i, IC j) { // calls the correct function
return bar( i, j, typename CGAL::Circulator_traits<IC>::category());
}
Examples:
Circulator/circulator_prog3.cpp.

Types

typedef unspecified_type category
 either Iterator_tag or Circulator_tag.
 
typedef unspecified_type iterator_category
 corresponding iterator category for circulators.
 
typedef unspecified_type circulator_category
 corresponding circulator category for iterator.