mirror of https://github.com/CGAL/cgal
Add move-semantic to T_2, CT_2, Dt_2, and CDT_2
Still todo: `Constrained_triangulation_plus_2`, and `Triangulation_hierarchy_2`.
This commit is contained in:
parent
14b8930f79
commit
75ec5c0da7
|
|
@ -141,6 +141,19 @@ public:
|
|||
virtual ~Constrained_Delaunay_triangulation_2() {}
|
||||
|
||||
|
||||
// Ensure rule-of-five: define the copy- and move- constructors
|
||||
// as well as the copy- and move- assignment operators.
|
||||
Constrained_Delaunay_triangulation_2(
|
||||
const Constrained_Delaunay_triangulation_2 &) = default;
|
||||
Constrained_Delaunay_triangulation_2(
|
||||
Constrained_Delaunay_triangulation_2 &&) = default;
|
||||
|
||||
Constrained_Delaunay_triangulation_2 &
|
||||
operator=(const Constrained_Delaunay_triangulation_2 &) = default;
|
||||
|
||||
Constrained_Delaunay_triangulation_2 &
|
||||
operator=(Constrained_Delaunay_triangulation_2 &&) = default;
|
||||
|
||||
// FLIPS
|
||||
bool is_flipable(Face_handle f, int i, bool perturb = true) const;
|
||||
void flip(Face_handle& f, int i);
|
||||
|
|
|
|||
|
|
@ -201,6 +201,17 @@ public:
|
|||
//TODO Is that destructor correct ?
|
||||
virtual ~Constrained_triangulation_2() {}
|
||||
|
||||
// Ensure rule-of-five: define the copy- and move- constructors
|
||||
// as well as the copy- and move- assignment operators.
|
||||
Constrained_triangulation_2(const Constrained_triangulation_2 &) = default;
|
||||
Constrained_triangulation_2(Constrained_triangulation_2 &&) = default;
|
||||
|
||||
Constrained_triangulation_2 &
|
||||
operator=(const Constrained_triangulation_2 &) = default;
|
||||
|
||||
Constrained_triangulation_2 &
|
||||
operator=(Constrained_triangulation_2 &&) = default;
|
||||
|
||||
|
||||
Constrained_edges_iterator constrained_edges_begin() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ public:
|
|||
: Triangulation_2<Gt,Tds>(tr)
|
||||
{ CGAL_triangulation_postcondition(is_valid()); }
|
||||
|
||||
Delaunay_triangulation_2(Delaunay_triangulation_2&&) = default;
|
||||
Delaunay_triangulation_2& operator=(const Delaunay_triangulation_2&) = default;
|
||||
Delaunay_triangulation_2& operator=(Delaunay_triangulation_2&&) = default;
|
||||
~Delaunay_triangulation_2() = default;
|
||||
|
||||
template <class InputIterator>
|
||||
Delaunay_triangulation_2(InputIterator first, InputIterator last,
|
||||
const Gt& gt = Gt())
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ public:
|
|||
// CONSTRUCTORS
|
||||
Triangulation_2(const Geom_traits& geom_traits=Geom_traits());
|
||||
Triangulation_2(const Triangulation_2<Gt,Tds> &tr);
|
||||
Triangulation_2(Triangulation_2&&) = default;
|
||||
|
||||
template <class InputIterator>
|
||||
Triangulation_2(InputIterator first, InputIterator last,
|
||||
|
|
@ -253,6 +254,10 @@ public:
|
|||
|
||||
//Assignement
|
||||
Triangulation_2 &operator=(const Triangulation_2 &tr);
|
||||
Triangulation_2 &operator=(Triangulation_2 &&) = default;
|
||||
|
||||
// Destructor
|
||||
~Triangulation_2() = default;
|
||||
|
||||
//Helping
|
||||
void copy_triangulation(const Triangulation_2 &tr);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ template <class Triangul>
|
|||
void
|
||||
_test_cls_const_Del_triangulation(const Triangul&)
|
||||
{
|
||||
static_assert(std::is_nothrow_move_constructible<Triangul>::value,
|
||||
"move cstr is missing");
|
||||
static_assert(std::is_nothrow_move_assignable<Triangul>::value,
|
||||
"move assignment is missing");
|
||||
|
||||
//typedef Triangulation Cls;
|
||||
typedef typename Triangul::Geom_traits Gt;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,11 @@ template <class Triang>
|
|||
void
|
||||
_test_cls_constrained_triangulation(const Triang &)
|
||||
{
|
||||
static_assert(std::is_nothrow_move_constructible<Triang>::value,
|
||||
"move cstr is missing");
|
||||
static_assert(std::is_nothrow_move_assignable<Triang>::value,
|
||||
"move assignment is missing");
|
||||
|
||||
// typedef Triangulation Cls;
|
||||
typedef typename Triang::Geom_traits Gt;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ template <class Del>
|
|||
void
|
||||
_test_cls_delaunay_triangulation_2( const Del & )
|
||||
{
|
||||
static_assert(std::is_nothrow_move_constructible<Del>::value,
|
||||
"move cstr is missing");
|
||||
static_assert(std::is_nothrow_move_assignable<Del>::value,
|
||||
"move assignment is missing");
|
||||
|
||||
//typedef Del Delaunay;
|
||||
typedef typename Del::Point Point;
|
||||
typedef typename Del::Locate_type Locate_type;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ template <class Triangul>
|
|||
void
|
||||
_test_cls_triangulation_2( const Triangul & )
|
||||
{
|
||||
static_assert(std::is_nothrow_move_constructible<Triangul>::value,
|
||||
"move cstr is missing");
|
||||
static_assert(std::is_nothrow_move_assignable<Triangul>::value,
|
||||
"move assignment is missing");
|
||||
//typedef Triangulation Cls;
|
||||
|
||||
// We assume the traits class has been tested already
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ protected:
|
|||
double _x, _y;
|
||||
public:
|
||||
Triangulation_test_point() {}
|
||||
Triangulation_test_point(const Point &p) : _x(p.test_x()), _y(p.test_y()) {}
|
||||
Triangulation_test_point(double x, double y) : _x(x), _y(y) {}
|
||||
Triangulation_test_point(double hx, double hy, double hw) :
|
||||
_x(hx/hw), _y(hy/hw)
|
||||
|
|
@ -47,7 +46,6 @@ public:
|
|||
bool compare(const Point &p) const
|
||||
{ return test_x()==p.test_x() && test_y()==p.test_y(); }
|
||||
bool uncompare(const Point &p) const { return !compare(p); }
|
||||
Point &operator=(const Point &p) { _x=p.test_x(); _y=p.test_y(); return *this; }
|
||||
void test_set(TESTFT x, TESTFT y) { _x=x; _y=y; }
|
||||
bool operator==(const Point &p) const {return this->compare(p);}
|
||||
};
|
||||
|
|
@ -436,11 +434,6 @@ public:
|
|||
typedef Triangulation_test_Construct_ray_2 Construct_ray_2;
|
||||
|
||||
|
||||
_Triangulation_test_traits() {}
|
||||
_Triangulation_test_traits(const _Triangulation_test_traits &) {}
|
||||
_Triangulation_test_traits &operator=
|
||||
(const _Triangulation_test_traits &) { return *this; }
|
||||
|
||||
Less_x_2
|
||||
less_x_2_object() const
|
||||
{ return Less_x_2();}
|
||||
|
|
|
|||
Loading…
Reference in New Issue