From 557b64e4a67febfe1e8940b21adc8267206aa17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 28 Apr 2023 20:54:15 +0200 Subject: [PATCH] boost::any ==> std::any --- .../Option_parser.cpp | 12 +++++----- .../Option_parser.hpp | 2 +- .../include/CGAL/sibson_gradient_fitting.h | 10 ++++----- .../Intersections_2/variant_any_object.cpp | 16 +++++++------- Nef_2/include/CGAL/Nef_2/HDS_items.h | 8 +++---- Nef_2/include/CGAL/Nef_2/PM_const_decorator.h | 4 ++-- Nef_2/include/CGAL/Nef_2/PM_decorator.h | 2 +- Nef_2/include/CGAL/Nef_2/PM_overlayer.h | 22 +++++++++---------- Nef_2/include/CGAL/Nef_2/PM_point_locator.h | 16 +++++++------- Nef_2/include/CGAL/Nef_2/gen_point_location.h | 16 +++++++------- Nef_2/include/CGAL/Nef_2/geninfo.h | 2 +- Nef_3/include/CGAL/Nef_3/Halfedge.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SFace.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SHalfedge.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h | 6 ++--- Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h | 2 +- .../include/CGAL/Nef_3/SNC_const_decorator.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_decorator.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_io_parser.h | 4 ++-- Nef_3/include/CGAL/Nef_3/Vertex.h | 4 ++-- .../include/CGAL/Nef_S2/SM_const_decorator.h | 4 ++-- Nef_S2/include/CGAL/Nef_S2/SM_decorator.h | 4 ++-- Nef_S2/include/CGAL/Nef_S2/SM_items.h | 10 ++++----- Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h | 22 +++++++++---------- Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h | 2 +- Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h | 14 ++++++------ .../CGAL/Polygon_mesh_processing/distance.h | 16 +++++++------- .../Polyhedron/Plugins/Mesh_3/Mesh_function.h | 8 +++---- STL_Extension/doc/STL_Extension/CGAL/Object.h | 2 +- .../doc/STL_Extension/STL_Extension.txt | 2 +- STL_Extension/include/CGAL/Object.h | 20 ++++++++--------- 31 files changed, 125 insertions(+), 125 deletions(-) diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp index 8a2bb5dd03c..a1032551da2 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.cpp @@ -18,7 +18,7 @@ char * Option_parser::s_strategy_opts[] = { }; template -void Option_parser::my_validate(boost::any & v, +void Option_parser::my_validate(std::any & v, const std::vector & values) { typedef std::vector Vector_id; @@ -28,11 +28,11 @@ void Option_parser::my_validate(boost::any & v, if (v.empty()) { Vector_id vec; vec.push_back(MyId(i)); - v = boost::any(vec); + v = std::any(vec); } else { - Vector_id vec = boost::any_cast(v); + Vector_id vec = std::any_cast(v); vec.push_back(MyId(i)); - v = boost::any(vec); + v = std::any(vec); } return; } @@ -41,14 +41,14 @@ void Option_parser::my_validate(boost::any & v, } /* Overload the 'validate' function for the user-defined class */ -void validate(boost::any & v, const std::vector & values, +void validate(std::any & v, const std::vector & values, Option_parser::Vector_type_id * target_type, int) { Option_parser::my_validate(v, values); } /* Overload the 'validate' function for the user-defined class */ -void validate(boost::any & v, const std::vector & values, +void validate(std::any & v, const std::vector & values, Option_parser::Vector_strategy_id * target_type, int) { Option_parser::my_validate(v, values); diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp index 4fcfc0aafd6..a20f3b804c2 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/Option_parser.hpp @@ -124,7 +124,7 @@ public: unsigned int get_height() const { return m_win_height; } template - static void my_validate(boost::any & v, + static void my_validate(std::any & v, const std::vector & values); protected: diff --git a/Interpolation/include/CGAL/sibson_gradient_fitting.h b/Interpolation/include/CGAL/sibson_gradient_fitting.h index 074ca037afb..f08600a4603 100644 --- a/Interpolation/include/CGAL/sibson_gradient_fitting.h +++ b/Interpolation/include/CGAL/sibson_gradient_fitting.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -229,7 +229,7 @@ sibson_gradient_fitting_nn_2(const Dt& dt, // of the value functor is 'DT::Point' or 'DT::Vertex_handle' std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { @@ -255,7 +255,7 @@ sibson_gradient_fitting_nn_2(const Dt& dt, const Traits& traits, std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { @@ -299,7 +299,7 @@ sibson_gradient_fitting_rn_2(const Rt& rt, // of the value functor is 'Rt::Point' (weighted point) or 'Rt::Vertex_handle' std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { @@ -325,7 +325,7 @@ sibson_gradient_fitting_rn_2(const Rt& rt, const Traits& traits, std::enable_if_t< std::is_constructible< - std::function, + std::function, ValueFunctor >::value>* = nullptr) { diff --git a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp index a7765e4b3c1..c5176eda212 100644 --- a/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp +++ b/Intersections_2/benchmark/Intersections_2/variant_any_object.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -78,7 +78,7 @@ intersection_variant(const typename K::Segment_2 &seg1, } template -boost::any intersection_any(const typename K::Segment_2 &seg1, +std::any intersection_any(const typename K::Segment_2 &seg1, const typename K::Segment_2 &seg2, const K&) { @@ -88,11 +88,11 @@ boost::any intersection_any(const typename K::Segment_2 &seg1, switch (ispair.intersection_type()) { case is_t::NO_INTERSECTION: default: - return boost::any(); + return std::any(); case is_t::POINT: - return boost::any(ispair.intersection_point()); + return std::any(ispair.intersection_point()); case is_t::SEGMENT: - return boost::any(ispair.intersection_segment()); + return std::any(ispair.intersection_segment()); } } @@ -165,10 +165,10 @@ struct Any_f : Vec_holder { Vec_holder(p, s) { } void operator()(const Segment& s1, const Segment& s2) { - boost::any obj = intersection_any(s1, s2, K()); - if (const Point * point = boost::any_cast(&obj)) { + std::any obj = intersection_any(s1, s2, K()); + if (const Point * point = std::any_cast(&obj)) { p->push_back(*point); - } else if (const Segment * segment = boost::any_cast(&obj)) { + } else if (const Segment * segment = std::any_cast(&obj)) { s->push_back(*segment); } } diff --git a/Nef_2/include/CGAL/Nef_2/HDS_items.h b/Nef_2/include/CGAL/Nef_2/HDS_items.h index 48a44c50fd7..12e1d32d873 100644 --- a/Nef_2/include/CGAL/Nef_2/HDS_items.h +++ b/Nef_2/include/CGAL/Nef_2/HDS_items.h @@ -22,7 +22,7 @@ #include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -62,7 +62,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Traits::Point Point; // geometric embedding @@ -151,7 +151,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename std::list::iterator fc_iterator; @@ -248,7 +248,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Traits::Mark Mark; // mark information diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index 7748f4b1f61..5a685f9e310 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -28,7 +28,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif #include @@ -137,7 +137,7 @@ typedef size_t Size_type; /*{\Mtypemember The size type.}*/ typedef void* GenPtr; #else -typedef boost::any GenPtr; +typedef std::any GenPtr; #endif diff --git a/Nef_2/include/CGAL/Nef_2/PM_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_decorator.h index 914a6a58d6a..6cc528c7dab 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_decorator.h @@ -19,7 +19,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index 5ce03215db3..882a349c9c9 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -23,7 +23,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 13 @@ -92,7 +92,7 @@ struct PMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(G.info(v)) = e; #else - *boost::any_cast(&G.info(v)) = e; + *std::any_cast(&G.info(v)) = e; #endif } @@ -102,7 +102,7 @@ struct PMO_from_segs { return geninfo::access(G.info(v)); #else return - boost::any_cast(G.info(v)); + std::any_cast(G.info(v)); #endif } @@ -112,7 +112,7 @@ struct PMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); #else - G.info(v)=boost::any(); + G.info(v)=std::any(); #endif } @@ -674,7 +674,7 @@ void discard_info(Vertex_handle v) const #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(v)); #else - info(v)=boost::any(); + info(v)=std::any(); #endif } @@ -684,7 +684,7 @@ vertex_info& ginfo(Vertex_handle v) const return geninfo::access(info(v)); #else return - *boost::any_cast(&info(v)); + *std::any_cast(&info(v)); #endif } @@ -729,8 +729,8 @@ void discard_info(Halfedge_handle e) const geninfo::clear(info(e)); geninfo::clear(info(twin(e))); #else - info(e)=boost::any(); - info(twin(e))=boost::any(); + info(e)=std::any(); + info(twin(e))=std::any(); #endif } @@ -740,7 +740,7 @@ halfedge_info& ginfo(Halfedge_handle e) const return geninfo::access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } @@ -782,7 +782,7 @@ void discard_info(Face_handle f) const #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(f)); #else - info(f)=boost::any(); + info(f)=std::any(); #endif } @@ -792,7 +792,7 @@ face_info& ginfo(Face_handle f) const return geninfo::access(info(f)); #else return - *boost::any_cast(&info(f)); + *std::any_cast(&info(f)); #endif } diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index ede8d2b033a..12a4a081267 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -28,7 +28,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #ifdef CGAL_USE_LEDA_LIBRARY @@ -497,7 +497,7 @@ protected: return geninfo::const_access(CT.info(v)).first; #else return - boost::any_cast(CT.info(v)).first; + std::any_cast(CT.info(v)).first; #endif } @@ -507,7 +507,7 @@ protected: return geninfo::const_access(CT.info(e)).first; #else return - boost::any_cast(CT.info(e)).first; + std::any_cast(CT.info(e)).first; #endif } @@ -517,7 +517,7 @@ protected: return geninfo::const_access(CT.info(e)).second; #else return - boost::any_cast(CT.info(e)).second; + std::any_cast(CT.info(e)).second; #endif } @@ -584,10 +584,10 @@ protected: f = geninfo::access(info(e_from)).second; #else f = - boost::any_cast(info(source(e))).second; + std::any_cast(info(source(e))).second; else f = - boost::any_cast(info(e_from)).second; + std::any_cast(info(e_from)).second; #endif mark(e) = _DP.mark(f); #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO @@ -968,7 +968,7 @@ PM_point_locator:: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(vit)); #else - CT.info(vit)=boost::any(); + CT.info(vit)=std::any(); #endif } Halfedge_iterator eit, eend = CT.halfedges_end(); @@ -976,7 +976,7 @@ PM_point_locator:: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(eit)); #else - CT.info(eit)=boost::any(); + CT.info(eit)=std::any(); #endif } CT.clear(); diff --git a/Nef_2/include/CGAL/Nef_2/gen_point_location.h b/Nef_2/include/CGAL/Nef_2/gen_point_location.h index c479a9af62a..1430b785ae0 100644 --- a/Nef_2/include/CGAL/Nef_2/gen_point_location.h +++ b/Nef_2/include/CGAL/Nef_2/gen_point_location.h @@ -27,7 +27,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif @@ -55,7 +55,7 @@ class GenericLocation { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif public: /*{\Mtypes}*/ @@ -89,7 +89,7 @@ public: return geninfo::const_access(value); #else return - *boost::any_cast(&value); + *std::any_cast(&value); #endif } /*{\Mconversion converts |\Mvar| into a node.\\ @@ -105,7 +105,7 @@ public: return geninfo::const_access(value); #else return - *boost::any_cast(&value); + *std::any_cast(&value); #endif } /*{\Mconversion converts |\Mvar| into an edge.\\ @@ -159,8 +159,8 @@ public: case NODE: geninfo::clear(value); break; case EDGE: geninfo::clear(value); break; #else - case NODE: value=boost::any(); break; - case EDGE: value=boost::any(); break; + case NODE: value=std::any(); break; + case EDGE: value=std::any(); break; #endif case NIL: break; } @@ -174,14 +174,14 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(value) = geninfo::const_access(L.value); #else - *boost_any_cast(&value) = boost::any_cast(L.value); + *boost_any_cast(&value) = std::any_cast(L.value); #endif break; case EDGE: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(value) = geninfo::const_access(L.value); #else - *boost::any_cast(&value) = boost::any_cast(L.value); + *std::any_cast(&value) = std::any_cast(L.value); #endif break; case NIL: break; diff --git a/Nef_2/include/CGAL/Nef_2/geninfo.h b/Nef_2/include/CGAL/Nef_2/geninfo.h index 08273c2e23e..41fab418e91 100644 --- a/Nef_2/include/CGAL/Nef_2/geninfo.h +++ b/Nef_2/include/CGAL/Nef_2/geninfo.h @@ -17,7 +17,7 @@ #define CGAL_DEPRECATED_HEADER "" #define CGAL_DEPRECATED_MESSAGE_DETAILS \ - "Something like boost::any or boost::variant should be used instead." + "Something like std::any or boost::variant should be used instead." #include #include diff --git a/Nef_3/include/CGAL/Nef_3/Halfedge.h b/Nef_3/include/CGAL/Nef_3/Halfedge.h index b4fc7065740..01c8df55785 100644 --- a/Nef_3/include/CGAL/Nef_3/Halfedge.h +++ b/Nef_3/include/CGAL/Nef_3/Halfedge.h @@ -31,7 +31,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -42,7 +42,7 @@ class Halfedge_base #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vector_3 Vector_3; diff --git a/Nef_3/include/CGAL/Nef_3/SFace.h b/Nef_3/include/CGAL/Nef_3/SFace.h index 3ee882271d6..c723b2cd4d0 100644 --- a/Nef_3/include/CGAL/Nef_3/SFace.h +++ b/Nef_3/include/CGAL/Nef_3/SFace.h @@ -29,7 +29,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -39,7 +39,7 @@ class SFace_base { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vertex_handle Vertex_handle; diff --git a/Nef_3/include/CGAL/Nef_3/SHalfedge.h b/Nef_3/include/CGAL/Nef_3/SHalfedge.h index 19339312f20..2191e73bbe6 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfedge.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfedge.h @@ -30,7 +30,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -40,7 +40,7 @@ class SHalfedge_base { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h index 6f60c188570..6cbc6be0ed8 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h @@ -18,7 +18,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include @@ -413,7 +413,7 @@ protected: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO Edge_of[geninfo::access(info(e_min->twin()->source()->twin()->source()))]; #else - Edge_of[ boost::any_cast(info(e_min->twin()->source()->twin()->source())) ]; + Edge_of[ std::any_cast(info(e_min->twin()->source()->twin()->source())) ]; #endif CGAL_assertion( e_below != SHalfedge_handle() ); CGAL_NEF_TRACEN(" edge below " << debug(e_below)); @@ -652,7 +652,7 @@ create_facet_objects(const Plane_3& plane_supporting_facet, #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO Edge_of[geninfo::access(info(l->incident_sface()->center_vertex()))]; #else - Edge_of[ boost::any_cast(info(l->incident_sface()->center_vertex())) ]; + Edge_of[ std::any_cast(info(l->incident_sface()->center_vertex())) ]; #endif CGAL_assertion( e_below != SHalfedge_handle() ); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h index 8c45ba71566..2c29bca697c 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h @@ -23,7 +23,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index 83f89e413b3..47e85c817ae 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -32,7 +32,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -118,7 +118,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif SNC_const_decorator() : sncp_(0) {} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index 61dcbb983ef..281fb0d0dcd 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -36,7 +36,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -157,7 +157,7 @@ class SNC_decorator : public SNC_const_decorator { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif SNC_decorator() : Base(), sncp_() {} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index 9aa445f38a1..c546843ffc5 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -37,7 +37,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif #include @@ -963,7 +963,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif using Base::visit_shell_objects; diff --git a/Nef_3/include/CGAL/Nef_3/Vertex.h b/Nef_3/include/CGAL/Nef_3/Vertex.h index 0a1d7bc280e..fdccc06bd03 100644 --- a/Nef_3/include/CGAL/Nef_3/Vertex.h +++ b/Nef_3/include/CGAL/Nef_3/Vertex.h @@ -30,7 +30,7 @@ #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -41,7 +41,7 @@ class Vertex_base { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Point_3 Point_3; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h index e1e1762dc8f..eb83d34928f 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h @@ -32,7 +32,7 @@ #define CGAL_NEF_DEBUG 67 #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -75,7 +75,7 @@ typedef size_t Size_type; #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else -typedef boost::any GenPtr; +typedef std::any GenPtr; #endif diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h index 4328b38f44c..8576d4488c8 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h @@ -31,7 +31,7 @@ #include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -84,7 +84,7 @@ typedef typename Sphere_kernel::Aff_transformation_3 Aff_transformation_3; #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else -typedef boost::any GenPtr; +typedef std::any GenPtr; #endif typedef typename Map::SVertex SVertex; typedef typename Map::SVertex_handle SVertex_handle; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_items.h b/Nef_S2/include/CGAL/Nef_S2/SM_items.h index d1141a21311..4508f4cc115 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_items.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_items.h @@ -27,7 +27,7 @@ #include #include #ifndef CGAL_I_DO_WANT_TO_USE_GENINFO -#include +#include #endif namespace CGAL { @@ -45,7 +45,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_point Sphere_point; @@ -127,7 +127,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; @@ -228,7 +228,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; @@ -306,7 +306,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; #else - typedef boost::any GenPtr; + typedef std::any GenPtr; #endif typedef typename Refs::Mark Mark; typedef typename Refs::Object_handle Object_handle; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h index 52c94bad708..24496cae987 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h @@ -23,7 +23,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include @@ -106,7 +106,7 @@ struct SMO_from_segs { return geninfo::access(G.info(v)); #else return - boost::any_cast( G.info(v) ); + std::any_cast( G.info(v) ); #endif } @@ -122,7 +122,7 @@ struct SMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); #else - G.info(v)=boost::any(); + G.info(v)=std::any(); #endif } @@ -141,7 +141,7 @@ struct SMO_from_segs { #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); #else - G.info(v)=boost::any(); + G.info(v)=std::any(); #endif } @@ -564,7 +564,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(v)); #else - info(v)=boost::any(); + info(v)=std::any(); #endif } @@ -574,7 +574,7 @@ public: return geninfo::access(info(v)); #else return - *boost::any_cast(&info(v)); + *std::any_cast(&info(v)); #endif } @@ -618,8 +618,8 @@ public: geninfo::clear(info(e)); geninfo::clear(info(e->twin())); #else - info(e)=boost::any(); - info(e->twin())=boost::any(); + info(e)=std::any(); + info(e->twin())=std::any(); #endif } @@ -629,7 +629,7 @@ public: return geninfo::access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } @@ -671,7 +671,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(f)); #else - info(f)=boost::any(); + info(f)=std::any(); #endif } @@ -681,7 +681,7 @@ public: return geninfo::access(info(f)); #else return - *boost::any_cast(&info(f)); + *std::any_cast(&info(f)); #endif } diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h index 8dbce0ced5e..ef9d45a7a6d 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h @@ -21,7 +21,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h index af50600aa4a..8c33ff31cc7 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h @@ -22,7 +22,7 @@ #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include #else -#include +#include #endif #include #include @@ -213,7 +213,7 @@ public: #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(info(v)); #else - info(v)=boost::any(); + info(v)=std::any(); #endif } @@ -223,7 +223,7 @@ public: return geninfo::access(info(v)); #else return - *boost::any_cast(&info(v)); + *std::any_cast(&info(v)); #endif } @@ -258,8 +258,8 @@ public: geninfo::clear(info(e)); geninfo::clear(info(e->twin())); #else - info(e)=boost::any(); - info(e->twin())=boost::any(); + info(e)=std::any(); + info(e->twin())=std::any(); #endif } @@ -269,7 +269,7 @@ public: return geninfo::access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } @@ -288,7 +288,7 @@ public: return geninfo::const_access(info(e)); #else return - *boost::any_cast(&info(e)); + *std::any_cast(&info(e)); #endif } const Mark& incident_mark(SHalfedge_const_handle e) const diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index 6d221c77bb9..28b6195b540 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -43,7 +43,7 @@ #include #endif // CGAL_LINKED_WITH_TBB -#include +#include #include #include @@ -1818,10 +1818,10 @@ struct Bounded_error_preprocessing #ifdef CGAL_HAUSDORFF_DEBUG using Timer = CGAL::Real_timer; #endif - std::vector& tm_wrappers; + std::vector& tm_wrappers; // Constructor. - Bounded_error_preprocessing(std::vector& tm_wrappers) + Bounded_error_preprocessing(std::vector& tm_wrappers) : tm_wrappers(tm_wrappers) { } @@ -1830,8 +1830,8 @@ struct Bounded_error_preprocessing : tm_wrappers(s.tm_wrappers) { } - bool is_tm1_wrapper(const boost::any& operand) const { return operand.type() == typeid(TM1Wrapper); } - bool is_tm2_wrapper(const boost::any& operand) const { return operand.type() == typeid(TM2Wrapper); } + bool is_tm1_wrapper(const std::any& operand) const { return operand.type() == typeid(TM1Wrapper); } + bool is_tm2_wrapper(const std::any& operand) const { return operand.type() == typeid(TM2Wrapper); } // TODO: make AABB tree build parallel! void operator()(const tbb::blocked_range& range) @@ -1849,12 +1849,12 @@ struct Bounded_error_preprocessing auto& tm_wrapper = tm_wrappers[i]; if(is_tm1_wrapper(tm_wrapper)) { - TM1Wrapper& object = boost::any_cast(tm_wrapper); + TM1Wrapper& object = std::any_cast(tm_wrapper); object.build_tree(); } else if(is_tm2_wrapper(tm_wrapper)) { - TM2Wrapper& object = boost::any_cast(tm_wrapper); + TM2Wrapper& object = std::any_cast(tm_wrapper); object.build_tree(); } else @@ -2031,7 +2031,7 @@ bounded_error_squared_one_sided_Hausdorff_distance_impl(const TriangleMesh1& tm1 std::vector tm1_parts; std::vector tm1_trees; - std::vector tm_wrappers; + std::vector tm_wrappers; #endif // defined(CGAL_LINKED_WITH_TBB) && defined(CGAL_METIS_ENABLED) #ifdef CGAL_HAUSDORFF_DEBUG diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index db87cc01bfd..c7fa41d15d5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -34,7 +34,7 @@ #include // for C3t3_initializer #include -#include +#include namespace CGAL { class Image_3; @@ -114,7 +114,7 @@ private: void tweak_criteria(Mesh_criteria&, Mesh_fnt::Domain_tag) {} void tweak_criteria(Mesh_criteria&, Mesh_fnt::Polyhedral_domain_tag); private: - boost::any object_to_destroy; + std::any object_to_destroy; C3t3& c3t3_; Domain* const domain_; Mesh_parameters const p_; @@ -268,10 +268,10 @@ edge_criteria(double edge_size, Mesh_fnt::Polyhedral_domain_tag) domain_->aabb_tree(), *domain_); // The sizing field object, as well as the `patch_ids_vector` are - // allocated on the heap, and the following `boost::any` object, + // allocated on the heap, and the following `std::any` object, // containing two shared pointers, is used to make the allocated // objects be destroyed at the destruction of the thread object, using - // type erasure (`boost::any`). + // type erasure (`std::any`). object_to_destroy = std::make_pair(QSharedPointer(sizing_field_ptr), QSharedPointer(patches_ids_vector_p)); diff --git a/STL_Extension/doc/STL_Extension/CGAL/Object.h b/STL_Extension/doc/STL_Extension/CGAL/Object.h index ddf919ef64a..7a329af795f 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Object.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Object.h @@ -19,7 +19,7 @@ this is done with the global function `make_object()`. This encapsulation mechanism requires the use of `assign` or `object_cast` to use the functionality of the encapsulated class. -This class is similar in spirit to `boost::any`. +This class is similar in spirit to `std::any`. \cgalHeading{Example} diff --git a/STL_Extension/doc/STL_Extension/STL_Extension.txt b/STL_Extension/doc/STL_Extension/STL_Extension.txt index b793a86550a..b37ecb282e8 100644 --- a/STL_Extension/doc/STL_Extension/STL_Extension.txt +++ b/STL_Extension/doc/STL_Extension/STL_Extension.txt @@ -142,7 +142,7 @@ For handles and indices of vertices, halfedges, faces, etc., we provide speciali The class `Object` can store an object of whatever other type. It can be used by a function to return objects of different types. A mechanism to extract the stored object based on its type is also provided. -This class is similar to `boost::any`. +This class is similar to `std::any`. \section stl_uncertainty Uncertainty Management diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 33a01aac875..24d6ecc1b12 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -29,20 +29,20 @@ #include #include -#include +#include #include namespace CGAL { class Object { - std::shared_ptr obj; + std::shared_ptr obj; // returns an any pointer from a variant - struct Any_from_variant : public boost::static_visitor { + struct Any_from_variant : public boost::static_visitor { template - boost::any* operator()(const T& t) const { - return new boost::any(t); + std::any* operator()(const T& t) const { + return new std::any(t); } }; @@ -61,7 +61,7 @@ class Object Object() : obj() { } template - Object(T && t, private_tag) : obj(new boost::any(std::forward(t))) { } + Object(T && t, private_tag) : obj(new std::any(std::forward(t))) { } // implicit constructor from optionals containing variants template @@ -76,7 +76,7 @@ class Object template bool assign(T &t) const { - const T* res = boost::any_cast(obj.get()); + const T* res = std::any_cast(obj.get()); if (!res) return false; t = *res; return true; @@ -105,7 +105,7 @@ class Object template bool is() const { - return obj && boost::any_cast(obj.get()); + return obj && std::any_cast(obj.get()); } const std::type_info & type() const @@ -159,14 +159,14 @@ template inline const T * object_cast(const Object * o) { - return boost::any_cast((o->obj).get()); + return std::any_cast((o->obj).get()); } template inline T object_cast(const Object & o) { - const T * result = boost::any_cast((o.obj).get()); + const T * result = std::any_cast((o.obj).get()); if (!result) throw Bad_object_cast(); return *result;