![]() |
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.
#include <CGAL/circulator.h>
|
| |
|
either Iterator_tag or
Circulator_tag.
| |
|
| |
|
corresponding iterator category for circulators.
| |
|
| |
|
corresponding circulator category for iterator
| |
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) {
CGAL::Assert_iterator(i);
// This function is called for iterator ranges [i,j).
}
template <class C>
void bar( C c, C d, CGAL::Circulator_tag) {
CGAL::Assert_circulator(c);
// 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());
}