mirror of https://github.com/CGAL/cgal
remove duplicated example files
This commit is contained in:
parent
ff2f2cf79f
commit
a940e7a79d
|
|
@ -1,28 +0,0 @@
|
|||
// circulator_prog1.C
|
||||
// ------------------------
|
||||
#include <CGAL/basic.h>
|
||||
#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;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
// circulator_prog2.C
|
||||
// ------------------------
|
||||
#include <CGAL/basic.h>
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <CGAL/circulator.h>
|
||||
|
||||
typedef CGAL::Circulator_from_container< std::vector<int> > 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);
|
||||
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;
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
// circulator_prog3.C
|
||||
// ------------------------
|
||||
#include <CGAL/basic.h>
|
||||
#include <cassert>
|
||||
#include <list>
|
||||
#include <CGAL/circulator.h>
|
||||
|
||||
template <class C> inline int foo( C c, std::forward_iterator_tag) {
|
||||
CGAL::Assert_circulator( c);
|
||||
CGAL::Assert_forward_category( c);
|
||||
return 1;
|
||||
}
|
||||
template <class C> inline int foo( C c, std::random_access_iterator_tag) {
|
||||
CGAL::Assert_circulator( c);
|
||||
CGAL::Assert_random_access_category( c);
|
||||
return 2;
|
||||
}
|
||||
template <class I> inline int foo( I i, CGAL::Iterator_tag) {
|
||||
CGAL::Assert_iterator( i);
|
||||
return 3;
|
||||
}
|
||||
|
||||
template <class C> inline int foo( C c, CGAL::Circulator_tag) {
|
||||
CGAL::Assert_circulator( c);
|
||||
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 CGAL::Circulator_traits<IC> Traits;
|
||||
typedef typename Traits::category category;
|
||||
return foo( ic, category());
|
||||
}
|
||||
|
||||
int main() {
|
||||
typedef CGAL::Forward_circulator_base<int> F;
|
||||
typedef CGAL::Random_access_circulator_base<int> R;
|
||||
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;
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
// circulator_prog1.C
|
||||
// ------------------------
|
||||
#include <CGAL/basic.h>
|
||||
#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;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
// circulator_prog2.C
|
||||
// ------------------------
|
||||
#include <CGAL/basic.h>
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <CGAL/circulator.h>
|
||||
|
||||
typedef CGAL::Circulator_from_container< std::vector<int> > 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);
|
||||
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;
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
// circulator_prog3.C
|
||||
// ------------------------
|
||||
#include <CGAL/basic.h>
|
||||
#include <cassert>
|
||||
#include <list>
|
||||
#include <CGAL/circulator.h>
|
||||
|
||||
template <class C> inline int foo( C c, std::forward_iterator_tag) {
|
||||
CGAL::Assert_circulator( c);
|
||||
CGAL::Assert_forward_category( c);
|
||||
return 1;
|
||||
}
|
||||
template <class C> inline int foo( C c, std::random_access_iterator_tag) {
|
||||
CGAL::Assert_circulator( c);
|
||||
CGAL::Assert_random_access_category( c);
|
||||
return 2;
|
||||
}
|
||||
template <class I> inline int foo( I i, CGAL::Iterator_tag) {
|
||||
CGAL::Assert_iterator( i);
|
||||
return 3;
|
||||
}
|
||||
|
||||
template <class C> inline int foo( C c, CGAL::Circulator_tag) {
|
||||
CGAL::Assert_circulator( c);
|
||||
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 CGAL::Circulator_traits<IC> Traits;
|
||||
typedef typename Traits::category category;
|
||||
return foo( ic, category());
|
||||
}
|
||||
|
||||
int main() {
|
||||
typedef CGAL::Forward_circulator_base<int> F;
|
||||
typedef CGAL::Random_access_circulator_base<int> R;
|
||||
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;
|
||||
}
|
||||
Loading…
Reference in New Issue