formatting

This commit is contained in:
Sylvain Pion 2006-12-03 01:03:34 +00:00
parent 769017938d
commit 096f1ffb9a
2 changed files with 32 additions and 50 deletions

View File

@ -169,8 +169,12 @@ print_dag(const Origin& nv, std::ostream& os, int level)
// Abstract base class for lazy numbers and lazy objects // Abstract base class for lazy numbers and lazy objects
template <typename AT_, typename ET, typename E2A> template <typename AT_, typename ET, typename E2A>
struct Lazy_rep : public Rep class Lazy_rep : public Rep
{ {
Lazy_rep (const Lazy_rep&) { std::abort(); } // cannot be copied.
public:
typedef AT_ AT; typedef AT_ AT;
AT at; AT at;
@ -187,10 +191,6 @@ struct Lazy_rep : public Rep
: at(a), et(new ET(e)) : at(a), et(new ET(e))
{} {}
private:
Lazy_rep (const Lazy_rep&) { std::abort(); } // cannot be copied.
public:
const AT& approx() const const AT& approx() const
{ {
return at; return at;
@ -309,12 +309,10 @@ public:
l1_ = L1(); l1_ = L1();
} }
Lazy_rep_1(const AC& ac, const EC& ec, const L1& l1) Lazy_rep_1(const AC& ac, const EC& ec, const L1& l1)
: Lazy_rep<AT,ET, E2A>(ac(CGAL::approx(l1))), EC(ec), l1_(l1) : Lazy_rep<AT,ET, E2A>(ac(CGAL::approx(l1))), EC(ec), l1_(l1)
{} {}
#ifdef CGAL_LAZY_KERNEL_DEBUG #ifdef CGAL_LAZY_KERNEL_DEBUG
void void
print_dag(std::ostream& os, int level) const print_dag(std::ostream& os, int level) const
@ -328,7 +326,6 @@ public:
#endif #endif
unsigned depth() const { return CGAL::depth(l1_) + 1; } unsigned depth() const { return CGAL::depth(l1_) + 1; }
}; };
@ -1069,6 +1066,7 @@ public :
typedef AT Approximate_type; typedef AT Approximate_type;
typedef ET Exact_type; typedef ET Exact_type;
/*
typedef Self Rep; typedef Self Rep;
const Rep& rep() const const Rep& rep() const
@ -1080,17 +1078,7 @@ public :
{ {
return *this; return *this;
} }
*/
private:
struct dummy_zero_tag{};
Lazy(dummy_zero_tag)
{
PTR = new Lazy_rep_0<AT,ET, E2A>();
}
public:
Lazy() Lazy()
: Handle(zero()) {} : Handle(zero()) {}
@ -1138,12 +1126,11 @@ private:
// which is in particular heavily used for pruning DAGs. // which is in particular heavily used for pruning DAGs.
static const Self & zero() static const Self & zero()
{ {
static const Self z = Lazy(dummy_zero_tag()); static const Self z = new Lazy_rep_0<AT, ET, E2A>();
return z; return z;
} }
Self_rep * ptr() const { return (Self_rep*) PTR; } Self_rep * ptr() const { return (Self_rep*) PTR; }
}; };

View File

@ -108,10 +108,6 @@ struct Lazy_exact_nt_rep : public Lazy_exact_nt<ET>::Self_rep
this->print_at_et(os, level); this->print_at_et(os, level);
} }
#endif #endif
private:
Lazy_exact_nt_rep (const Lazy_exact_nt_rep&) { std::abort(); } // cannot be copied.
}; };
// int constant // int constant
@ -124,7 +120,6 @@ struct Lazy_exact_Int_Cst : public Lazy_exact_nt_rep<ET>
void update_exact() { this->et = new ET((int)this->approx().inf()); } void update_exact() { this->et = new ET((int)this->approx().inf()); }
unsigned depth() const { return 0; } unsigned depth() const { return 0; }
}; };
// double constant // double constant