mirror of https://github.com/CGAL/cgal
fix for STL debug mode
It is invalid to try to detect if an iterator is singular or value-initialized.
The only operations allowed with value-initialized iterators are:
- copy the iterator, or
- destroy or assign the iterator.
Comparisons like `vertex_it == Vertex_it{}` are not allowed.
This commit is contained in:
parent
571c2ccadc
commit
d837dbde21
|
|
@ -365,26 +365,11 @@ public:
|
||||||
// - Otherwise all members must be valid pointers or dereferencable iterators.
|
// - Otherwise all members must be valid pointers or dereferencable iterators.
|
||||||
|
|
||||||
bool is_singular() const {
|
bool is_singular() const {
|
||||||
CGAL_assertion((hierarchy == nullptr) == (constraint_it == Constraint_iterator{}));
|
|
||||||
CGAL_assertion((hierarchy != nullptr) || (vertex_it == Vertex_it{}));
|
|
||||||
return hierarchy == nullptr;
|
return hierarchy == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_valid() const {
|
bool is_valid() const {
|
||||||
if(hierarchy == nullptr) {
|
return (hierarchy != nullptr);
|
||||||
CGAL_assertion(is_singular());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(constraint_it == Constraint_iterator{}) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(constraint_it == hierarchy->constraints_end()) {
|
|
||||||
return vertex_it == Vertex_it{};
|
|
||||||
}
|
|
||||||
if(vertex_it == Vertex_it{}) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_end() const {
|
bool is_end() const {
|
||||||
|
|
@ -406,8 +391,8 @@ public:
|
||||||
bool equal(const Subconstraint_iterator& other) const {
|
bool equal(const Subconstraint_iterator& other) const {
|
||||||
if(hierarchy != other.hierarchy) return false;
|
if(hierarchy != other.hierarchy) return false;
|
||||||
if(is_singular()) return true;
|
if(is_singular()) return true;
|
||||||
return (constraint_it == other.constraint_it &&
|
|
||||||
vertex_it == other.vertex_it);
|
return (constraint_it == other.constraint_it) && (this->is_end() == other.is_end());
|
||||||
}
|
}
|
||||||
|
|
||||||
Vertex_it begin_or_null(Constraint_iterator constraint_it) const {
|
Vertex_it begin_or_null(Constraint_iterator constraint_it) const {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue