CGAL 5.6.3 - Handles and Circulators

Loading...
Searching...
No Matches
Circulator/circulator_prog1.cpp
#include <cassert>
#include <vector>
#include <algorithm>
#include <CGAL/circulator.h>
typedef std::vector<int>::iterator I;
typedef CGAL::Circulator_from_iterator<I> Circulator;
typedef CGAL::Container_from_circulator<Circulator> Container;
typedef Container::iterator Iterator;
int main() {
std::vector<int> v;
v.push_back(5);
v.push_back(2);
v.push_back(9);
Circulator c( v.begin(), v.end());
Container container( c);
std::sort( container.begin(), container.end());
Iterator i = container.begin();
assert( *i == 2);
i++; assert( *i == 5);
i++; assert( *i == 9);
i++; assert( i == container.end());
return 0;
}
CGAL::Circulator_from_iterator
The adaptor Circulator_from_iterator converts two iterators of type I, a begin and a past-the-end val...
Definition: circulator.h:224
CGAL::Container_from_circulator
The adaptor Container_from_circulator is a class that converts any circulator type C to a kind of con...
Definition: circulator.h:430
Circulator
A Circulator is similar to an Iterator, with the difference that it is designed for circular data str...
Definition: Circulator.h:297
Container
Iterator