mirror of https://github.com/CGAL/cgal
Merge pull request #2230 from sgiraudot/Point_set_3-Bugfix_remove_index-GF
Point set 3: bug fix remove index
This commit is contained in:
commit
cc65b11d6d
|
|
@ -581,8 +581,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void remove (const Index& index)
|
void remove (const Index& index)
|
||||||
{
|
{
|
||||||
std::swap (index, *(end() - 1));
|
remove (m_indices.begin() + index);
|
||||||
++ m_nb_removed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,12 @@ int main (int, char**)
|
||||||
point_set.collect_garbage();
|
point_set.collect_garbage();
|
||||||
test (!(point_set.has_garbage()), "point set shouldn't have garbage.");
|
test (!(point_set.has_garbage()), "point set shouldn't have garbage.");
|
||||||
|
|
||||||
|
point_set.remove (*(point_set.begin()));
|
||||||
|
|
||||||
|
test (point_set.has_garbage(), "point set should have garbage.");
|
||||||
|
point_set.collect_garbage();
|
||||||
|
test (!(point_set.has_garbage()), "point set shouldn't have garbage.");
|
||||||
|
|
||||||
test (!(point_set.has_property_map<Color> ("color")), "point set shouldn't have colors.");
|
test (!(point_set.has_property_map<Color> ("color")), "point set shouldn't have colors.");
|
||||||
Point_set::Property_map<Color> color_prop;
|
Point_set::Property_map<Color> color_prop;
|
||||||
bool garbage;
|
bool garbage;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue