CGAL 5.1 - Handles and Circulators
Circulator/circulator_prog3.cpp
#include <cassert>
#include <list>
#include <CGAL/circulator.h>
template <class C> inline int foo( C c, std::forward_iterator_tag) {
return 1;
}
template <class C> inline int foo( C c, std::random_access_iterator_tag) {
return 2;
}
template <class I> inline int foo( I i, CGAL::Iterator_tag) {
return 3;
}
template <class C> inline int foo( C c, CGAL::Circulator_tag) {
typedef std::iterator_traits<C> Traits;
typedef typename Traits::iterator_category iterator_category;
return foo( c, iterator_category());
}
template <class IC> inline int foo( IC ic) {
typedef typename Traits::category category;
return foo( ic, category());
}
int main() {
F f = F();
R r = R();
std::list<int> l;
assert( foo( f) == 1);
assert( foo( r) == 2);
assert( foo( l.begin()) == 3);
return 0;
}
CGAL::Assert_circulator
void Assert_circulator(const C &c)
CGAL::Forward_circulator_base
Definition: circulator_bases.h:94
CGAL::Assert_forward_category
void Assert_forward_category(const IC &ic)
CGAL::Iterator_tag
Definition: circulator_bases.h:59
CGAL::Circulator_tag
Definition: circulator_bases.h:53
CGAL::Circulator_traits
Definition: circulator.h:343
CGAL::Assert_random_access_category
void Assert_random_access_category(const IC &ic)
CGAL::Random_access_circulator_base
Definition: circulator_bases.h:106
CGAL::Assert_iterator
void Assert_iterator(const I &i)