boost::prior -> std::prev

This commit is contained in:
Sébastien Loriot 2023-04-23 19:49:16 +02:00
parent b8571795b6
commit 99619dc634
17 changed files with 37 additions and 37 deletions

View File

@ -255,7 +255,7 @@ public:
std::back_inserter(cells), std::back_inserter(cells),
Emptyset_iterator())); Emptyset_iterator()));
Facet facet=*boost::prior(facets_on_the_boundary_of_the_hole.end()); Facet facet=*std::prev(facets_on_the_boundary_of_the_hole.end());
// Remember the points that are hidden by the conflicting cells, // Remember the points that are hidden by the conflicting cells,
// as they will be deleted during the insertion. // as they will be deleted during the insertion.

View File

@ -613,7 +613,7 @@ partition_outside_sets(const std::list<Face_handle>& new_facets,
} }
if(! point_list.empty()){ if(! point_list.empty()){
pending_facets.push_back(f); pending_facets.push_back(f);
f->it = boost::prior(pending_facets.end()); f->it = std::prev(pending_facets.end());
} else { } else {
f->it = pending_facets.end(); f->it = pending_facets.end();
} }
@ -748,7 +748,7 @@ void non_coplanar_quickhull_3(std::list<typename Traits::Point_3>& points,
for(Face_iterator fit = tds.faces_begin(); fit != tds.faces_end(); ++fit){ for(Face_iterator fit = tds.faces_begin(); fit != tds.faces_end(); ++fit){
if (! fit->points.empty()){ if (! fit->points.empty()){
pending_facets.push_back(fit); pending_facets.push_back(fit);
fit->it = boost::prior(pending_facets.end()); fit->it = std::prev(pending_facets.end());
} else { } else {
fit->it = pending_facets.end(); fit->it = pending_facets.end();
} }

View File

@ -101,12 +101,12 @@ public:
Cartesian_const_iterator cartesian_begin() const Cartesian_const_iterator cartesian_begin() const
{ {
return make_cartesian_const_iterator_begin(CGAL::get_pointee_or_identity(base).begin(), return make_cartesian_const_iterator_begin(CGAL::get_pointee_or_identity(base).begin(),
boost::prior(CGAL::get_pointee_or_identity(base).end())); std::prev(CGAL::get_pointee_or_identity(base).end()));
} }
Cartesian_const_iterator cartesian_end() const Cartesian_const_iterator cartesian_end() const
{ {
return make_cartesian_const_iterator_end(boost::prior(CGAL::get_pointee_or_identity(base).end())); return make_cartesian_const_iterator_end(std::prev(CGAL::get_pointee_or_identity(base).end()));
} }
int dimension() const; int dimension() const;

View File

@ -117,12 +117,12 @@ public:
Cartesian_const_iterator cartesian_begin() const Cartesian_const_iterator cartesian_begin() const
{ {
return make_cartesian_const_iterator_begin(get_pointee_or_identity(base).begin(), return make_cartesian_const_iterator_begin(get_pointee_or_identity(base).begin(),
boost::prior(get_pointee_or_identity(base).end())); std::prev(get_pointee_or_identity(base).end()));
} }
Cartesian_const_iterator cartesian_end() const Cartesian_const_iterator cartesian_end() const
{ {
return make_cartesian_const_iterator_end(boost::prior(get_pointee_or_identity(base).end())); return make_cartesian_const_iterator_end(std::prev(get_pointee_or_identity(base).end()));
} }
int dimension() const { return 3; }; int dimension() const { return 3; };

View File

@ -53,8 +53,8 @@ void intersection_coplanar_triangles_cutoff(const typename Kernel::Point_3& p,
CGAL_kernel_assertion_code(int pt_added = 0;) CGAL_kernel_assertion_code(int pt_added = 0;)
const typename Kernel::Point_3* prev = &(*boost::prior(inter_pts.end())); const typename Kernel::Point_3* prev = &(*std::prev(inter_pts.end()));
Iterator stop = inter_pts.size() > 2 ? inter_pts.end() : boost::prior(inter_pts.end()); Iterator stop = inter_pts.size() > 2 ? inter_pts.end() : std::prev(inter_pts.end());
for(Iterator it=inter_pts.begin(); it!=stop; ++it) for(Iterator it=inter_pts.begin(); it!=stop; ++it)
{ {
const typename Kernel::Point_3& curr = *it; const typename Kernel::Point_3& curr = *it;
@ -123,7 +123,7 @@ intersection_coplanar_triangles(const typename K::Triangle_3& t1,
k.construct_segment_3_object()(*inter_pts.begin(), *boost::next(inter_pts.begin())) ); k.construct_segment_3_object()(*inter_pts.begin(), *boost::next(inter_pts.begin())) );
case 3: case 3:
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>( return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(
k.construct_triangle_3_object()(*inter_pts.begin(), *boost::next(inter_pts.begin()), *boost::prior(inter_pts.end())) ); k.construct_triangle_3_object()(*inter_pts.begin(), *boost::next(inter_pts.begin()), *std::prev(inter_pts.end())) );
default: default:
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>( return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(
std::vector<typename K::Point_3>(inter_pts.begin(),inter_pts.end())); std::vector<typename K::Point_3>(inter_pts.begin(),inter_pts.end()));

View File

@ -2098,7 +2098,7 @@ repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out)
// `check_and_repopulate_edges()::vertices` before it is passed itself // `check_and_repopulate_edges()::vertices` before it is passed itself
// to `repopulate_edges_around_corner()`. // to `repopulate_edges_around_corner()`.
if(c3t3_.is_in_complex(to_repopulate.back())) if(c3t3_.is_in_complex(to_repopulate.back()))
std::copy(to_repopulate.begin(), boost::prior(to_repopulate.end()), out); std::copy(to_repopulate.begin(), std::prev(to_repopulate.end()), out);
else else
std::copy(to_repopulate.begin(), to_repopulate.end(), out); std::copy(to_repopulate.begin(), to_repopulate.end(), out);

View File

@ -29,7 +29,7 @@
#include <CGAL/Mesh_3/internal/Graph_manipulations.h> #include <CGAL/Mesh_3/internal/Graph_manipulations.h>
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/adjacency_list.hpp>
#include <boost/utility.hpp> // for boost::prior #include <boost/utility.hpp> // for std::prev
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <CGAL/Search_traits_3.h> #include <CGAL/Search_traits_3.h>
@ -388,7 +388,7 @@ void snap_graph_vertices(Graph& graph,
if(poly_it->begin() != poly_it->end()) { if(poly_it->begin() != poly_it->end()) {
tree.insert(*poly_it->begin()); tree.insert(*poly_it->begin());
if(boost::next(poly_it->begin()) != poly_it->end()) { if(boost::next(poly_it->begin()) != poly_it->end()) {
tree.insert(*boost::prior(poly_it->end())); tree.insert(*std::prev(poly_it->end()));
} }
} }
} }

View File

@ -37,7 +37,7 @@
#include <algorithm> #include <algorithm>
#include <type_traits> #include <type_traits>
#include <boost/next_prior.hpp> // for boost::prior and boost::next #include <boost/next_prior.hpp> // for std::prev and boost::next
#include <boost/variant.hpp> #include <boost/variant.hpp>
#include <memory> #include <memory>
@ -883,7 +883,7 @@ public:
} }
Curve_index maximal_curve_index() const { Curve_index maximal_curve_index() const {
if(edges_incidences_.empty()) return Curve_index(); if(edges_incidences_.empty()) return Curve_index();
return boost::prior(edges_incidences_.end())->first; return std::prev(edges_incidences_.end())->first;
} }
void build_curves_aabb_tree() const { void build_curves_aabb_tree() const {
@ -1458,9 +1458,9 @@ insert_edge(InputIterator first, InputIterator end)
// 'compute_corners_incidences()', that corner is incident only to a // 'compute_corners_incidences()', that corner is incident only to a
// loop, then it will be removed from the set of corners. // loop, then it will be removed from the set of corners.
register_corner(*first, curve_index); register_corner(*first, curve_index);
if ( *first != *boost::prior(end) ) if ( *first != *std::prev(end) )
{ {
register_corner(*boost::prior(end), curve_index); register_corner(*std::prev(end), curve_index);
} }
// Create a new polyline // Create a new polyline

View File

@ -3126,7 +3126,7 @@ repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out)
// `check_and_repopulate_edges()::vertices` before it is passed itself // `check_and_repopulate_edges()::vertices` before it is passed itself
// to `repopulate_edges_around_corner()`. // to `repopulate_edges_around_corner()`.
if(c3t3_.is_in_complex(to_repopulate.back())) if(c3t3_.is_in_complex(to_repopulate.back()))
std::copy(to_repopulate.begin(), boost::prior(to_repopulate.end()), out); std::copy(to_repopulate.begin(), std::prev(to_repopulate.end()), out);
else else
std::copy(to_repopulate.begin(), to_repopulate.end(), out); std::copy(to_repopulate.begin(), to_repopulate.end(), out);

View File

@ -243,9 +243,9 @@ struct Intersect_coplanar_faces_3
CGAL_assertion_code(int pt_added=0;) CGAL_assertion_code(int pt_added=0;)
Inter_pt_info* prev = &(*boost::prior(inter_pts.end())); Inter_pt_info* prev = &(*std::prev(inter_pts.end()));
bool inter_pts_size_g_2 = inter_pts.size() > 2; bool inter_pts_size_g_2 = inter_pts.size() > 2;
Iterator stop = inter_pts_size_g_2 ? inter_pts.end() : boost::prior(inter_pts.end()); Iterator stop = inter_pts_size_g_2 ? inter_pts.end() : std::prev(inter_pts.end());
for (Iterator it=inter_pts.begin();it!=stop;++it) for (Iterator it=inter_pts.begin();it!=stop;++it)
{ {
Inter_pt_info* curr=&(*it); Inter_pt_info* curr=&(*it);

View File

@ -622,9 +622,9 @@ void Scene_polylines_item::split_at_sharp_angles()
else else
++bare_polyline_it; ++bare_polyline_it;
if(it != bare_polyline.end()) { if(it != bare_polyline.end()) {
for(; it != boost::prior(bare_polyline.end()); ++it) { for(; it != std::prev(bare_polyline.end()); ++it) {
const Point_3 pv = *it; const Point_3 pv = *it;
const Point_3 pa = *boost::prior(it); const Point_3 pa = *std::prev(it);
const Point_3 pb = *boost::next(it); const Point_3 pb = *boost::next(it);
const K::Vector_3 av = pv - pa; const K::Vector_3 av = pv - pa;
const K::Vector_3 bv = pv - pb; const K::Vector_3 bv = pv - pb;
@ -647,7 +647,7 @@ void Scene_polylines_item::split_at_sharp_angles()
// if the polyline is a cycle, test if its beginning is a sharp // if the polyline is a cycle, test if its beginning is a sharp
// angle... // angle...
const Point_3 pv = *bare_polyline.begin(); const Point_3 pv = *bare_polyline.begin();
const Point_3 pa = *boost::prior(boost::prior(bare_polyline.end())); const Point_3 pa = *std::prev(std::prev(bare_polyline.end()));
const Point_3 pb = *boost::next(bare_polyline.begin()); const Point_3 pb = *boost::next(bare_polyline.begin());
const K::Vector_3 av = pv - pa; const K::Vector_3 av = pv - pa;
const K::Vector_3 bv = pv - pb; const K::Vector_3 bv = pv - pb;

View File

@ -65,7 +65,7 @@ public:
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ; Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
typedef typename Constrained_triangulation_plus_2<CDT>::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; typedef typename Constrained_triangulation_plus_2<CDT>::Vertices_in_constraint_iterator Vertices_in_constraint_iterator;
Vertices_in_constraint_iterator vicp = boost::prior(vicq); Vertices_in_constraint_iterator vicp = std::prev(vicq);
Vertices_in_constraint_iterator vicr = boost::next(vicq); Vertices_in_constraint_iterator vicr = boost::next(vicq);
Point const& lP = (*vicp)->point(); Point const& lP = (*vicp)->point();

View File

@ -61,7 +61,7 @@ public:
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ; Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
typedef typename Constrained_triangulation_plus_2<CDT>::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; typedef typename Constrained_triangulation_plus_2<CDT>::Vertices_in_constraint_iterator Vertices_in_constraint_iterator;
Vertices_in_constraint_iterator vicp = boost::prior(vicq); Vertices_in_constraint_iterator vicp = std::prev(vicq);
Vertices_in_constraint_iterator vicr = boost::next(vicq); Vertices_in_constraint_iterator vicr = boost::next(vicq);
Point const& lP = (*vicp)->point(); Point const& lP = (*vicp)->point();

View File

@ -66,7 +66,7 @@ public:
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ; Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
typedef typename Constrained_triangulation_plus_2<CDT>::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; typedef typename Constrained_triangulation_plus_2<CDT>::Vertices_in_constraint_iterator Vertices_in_constraint_iterator;
Vertices_in_constraint_iterator vicp = boost::prior(vicq); Vertices_in_constraint_iterator vicp = std::prev(vicq);
Vertices_in_constraint_iterator vicr = boost::next(vicq); Vertices_in_constraint_iterator vicr = boost::next(vicq);
Point const& lP = (*vicp)->point(); Point const& lP = (*vicp)->point();

View File

@ -154,11 +154,11 @@ public:
(*it)->set_removable(false); (*it)->set_removable(false);
++it; ++it;
for(; it != ite; ++it){ for(; it != ite; ++it){
if((boost::next(it) != ite) && (boost::prior(it)== boost::next(it))){ if((boost::next(it) != ite) && (std::prev(it)== boost::next(it))){
(*it)->set_removable(false); (*it)->set_removable(false);
} }
} }
it = boost::prior(it); it = std::prev(it);
(*it)->set_removable(false); (*it)->set_removable(false);
} }
@ -245,7 +245,7 @@ public:
} }
Vertex_handle vh = *it; Vertex_handle vh = *it;
Vertices_in_constraint_iterator u = boost::prior(it); Vertices_in_constraint_iterator u = std::prev(it);
Vertex_handle uh = *u; Vertex_handle uh = *u;
Vertices_in_constraint_iterator w = boost::next(it); Vertices_in_constraint_iterator w = boost::next(it);
Vertex_handle wh = *w; Vertex_handle wh = *w;
@ -322,7 +322,7 @@ operator()()
Vertices_in_constraint_iterator vit = vertex_to_iterator[v].front(); Vertices_in_constraint_iterator vit = vertex_to_iterator[v].front();
if(is_removable(vit)){ if(is_removable(vit)){
Vertices_in_constraint_iterator u = boost::prior(vit), w = boost::next(vit); Vertices_in_constraint_iterator u = std::prev(vit), w = boost::next(vit);
pct.simplify(vit); pct.simplify(vit);
if((*u)->is_removable()){ if((*u)->is_removable()){

View File

@ -86,8 +86,8 @@ BOOST_FIXTURE_TEST_CASE( test_single_skip, Fixture )
skips.begin(), skips.end()); skips.begin(), skips.end());
BOOST_CHECK_EQUAL_COLLECTIONS(l.all_begin(), l.all_end(), BOOST_CHECK_EQUAL_COLLECTIONS(l.all_begin(), l.all_end(),
all.begin(), all.end()); all.begin(), all.end());
l.skip(boost::prior(l.all_end())); l.skip(std::prev(l.all_end()));
BOOST_CHECK(l.is_skipped(boost::prior(l.all_end()))); BOOST_CHECK(l.is_skipped(std::prev(l.all_end())));
skips.erase(std::remove(skips.begin(), skips.end(), 7), skips.end()); skips.erase(std::remove(skips.begin(), skips.end(), 7), skips.end());
BOOST_CHECK_EQUAL_COLLECTIONS(l.skip_begin(), l.skip_end(), BOOST_CHECK_EQUAL_COLLECTIONS(l.skip_begin(), l.skip_end(),
skips.begin(), skips.end()); skips.begin(), skips.end());
@ -112,7 +112,7 @@ BOOST_FIXTURE_TEST_CASE( test_range_skip, Fixture )
BOOST_CHECK_EQUAL_COLLECTIONS(l.skip_begin(), l.skip_end(), BOOST_CHECK_EQUAL_COLLECTIONS(l.skip_begin(), l.skip_end(),
skips.begin(), skips.end()); skips.begin(), skips.end());
// drop 6 and 7 // drop 6 and 7
l.skip(boost::prior(l.all_end(), 2), l.all_end()); l.skip(std::prev(l.all_end(), 2), l.all_end());
skips.erase(std::remove(skips.begin(), skips.end(), 6), skips.end()); skips.erase(std::remove(skips.begin(), skips.end(), 6), skips.end());
skips.erase(std::remove(skips.begin(), skips.end(), 7), skips.end()); skips.erase(std::remove(skips.begin(), skips.end(), 7), skips.end());
BOOST_CHECK_EQUAL_COLLECTIONS(l.skip_begin(), l.skip_end(), BOOST_CHECK_EQUAL_COLLECTIONS(l.skip_begin(), l.skip_end(),
@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE( test_swap )
{ {
using std::swap; using std::swap;
Fixture a, b; Fixture a, b;
all_iterator it = boost::prior(b.l.all_end()); all_iterator it = std::prev(b.l.all_end());
b.l.push_back(8); b.l.push_back(9); b.l.push_back(10); b.l.push_back(8); b.l.push_back(9); b.l.push_back(10);
swap(a.l, b.l); swap(a.l, b.l);
@ -244,7 +244,7 @@ BOOST_AUTO_TEST_CASE( test_swap )
a.all.begin(), a.all.end()); a.all.begin(), a.all.end());
// this iterator should still be valid and now point into a // this iterator should still be valid and now point into a
BOOST_CHECK_EQUAL_COLLECTIONS(it, a.l.all_end(), BOOST_CHECK_EQUAL_COLLECTIONS(it, a.l.all_end(),
boost::prior(a.all.end(), 4), a.all.end()); std::prev(a.all.end(), 4), a.all.end());
} }
BOOST_AUTO_TEST_CASE( test_splice ) BOOST_AUTO_TEST_CASE( test_splice )

View File

@ -582,7 +582,7 @@ public:
insert_incident_faces(vcit, out); insert_incident_faces(vcit, out);
} }
//AF vertices_in_constraint_begin(ca)->fixed() = true; //AF vertices_in_constraint_begin(ca)->fixed() = true;
// Vertices_in_constraint_iterator end = boost::prior(vertices_in_constraint_end(ca)); // Vertices_in_constraint_iterator end = std::prev(vertices_in_constraint_end(ca));
// end->fixed() = true; // end->fixed() = true;
fc.write_faces(out); fc.write_faces(out);
@ -753,7 +753,7 @@ public:
void simplify(Vertices_in_constraint_iterator v) void simplify(Vertices_in_constraint_iterator v)
{ {
Vertices_in_constraint_iterator u = boost::prior(v); Vertices_in_constraint_iterator u = std::prev(v);
Vertices_in_constraint_iterator w = boost::next(v); Vertices_in_constraint_iterator w = boost::next(v);
bool unew = (*u != *w); bool unew = (*u != *w);
hierarchy.simplify(u,v,w); hierarchy.simplify(u,v,w);