boost::any ==> std::any

This commit is contained in:
Sébastien Loriot 2023-04-28 20:54:15 +02:00
parent 604dcdc435
commit 557b64e4a6
31 changed files with 125 additions and 125 deletions

View File

@ -18,7 +18,7 @@ char * Option_parser::s_strategy_opts[] = {
};
template <class MyId>
void Option_parser::my_validate(boost::any & v,
void Option_parser::my_validate(std::any & v,
const std::vector<std::string> & values)
{
typedef std::vector<MyId> 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<Vector_id>(v);
Vector_id vec = std::any_cast<Vector_id>(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<std::string> & values,
void validate(std::any & v, const std::vector<std::string> & values,
Option_parser::Vector_type_id * target_type, int)
{
Option_parser::my_validate<Option_parser::Type_id>(v, values);
}
/* Overload the 'validate' function for the user-defined class */
void validate(boost::any & v, const std::vector<std::string> & values,
void validate(std::any & v, const std::vector<std::string> & values,
Option_parser::Vector_strategy_id * target_type, int)
{
Option_parser::my_validate<Option_parser::Strategy_id>(v, values);

View File

@ -124,7 +124,7 @@ public:
unsigned int get_height() const { return m_win_height; }
template <class MyId>
static void my_validate(boost::any & v,
static void my_validate(std::any & v,
const std::vector<std::string> & values);
protected:

View File

@ -22,7 +22,7 @@
#include <CGAL/Origin.h>
#include <functional>
#include <boost/any.hpp>
#include <any>
#include <boost/mpl/if.hpp>
#include <boost/utility/result_of.hpp>
@ -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<boost::any(typename Dt::Point)>,
std::function<std::any(typename Dt::Point)>,
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<boost::any(typename Dt::Vertex_handle)>,
std::function<std::any(typename Dt::Vertex_handle)>,
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<boost::any(typename Rt::Point)>,
std::function<std::any(typename Rt::Point)>,
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<boost::any(typename Rt::Vertex_handle)>,
std::function<std::any(typename Rt::Vertex_handle)>,
ValueFunctor
>::value>* = nullptr)
{

View File

@ -12,7 +12,7 @@
#include <boost/variant.hpp>
#include <optional>
#include <boost/any.hpp>
#include <any>
#include <boost/timer.hpp>
#include <boost/lexical_cast.hpp>
@ -78,7 +78,7 @@ intersection_variant(const typename K::Segment_2 &seg1,
}
template <class K>
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<Point>(&obj)) {
std::any obj = intersection_any(s1, s2, K());
if (const Point * point = std::any_cast<Point>(&obj)) {
p->push_back(*point);
} else if (const Segment * segment = boost::any_cast<Segment>(&obj)) {
} else if (const Segment * segment = std::any_cast<Segment>(&obj)) {
s->push_back(*segment);
}
}

View File

@ -22,7 +22,7 @@
#include <optional>
#include <boost/none.hpp>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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<Halfedge_handle>::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

View File

@ -28,7 +28,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/use.h>
@ -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

View File

@ -19,7 +19,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/Unique_hash_map.h>
#include <vector>

View File

@ -23,7 +23,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#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<Halfedge_handle>::access(G.info(v)) = e;
#else
*boost::any_cast<Halfedge_handle>(&G.info(v)) = e;
*std::any_cast<Halfedge_handle>(&G.info(v)) = e;
#endif
}
@ -102,7 +102,7 @@ struct PMO_from_segs {
return geninfo<Halfedge_handle>::access(G.info(v));
#else
return
boost::any_cast<Halfedge_handle>(G.info(v));
std::any_cast<Halfedge_handle>(G.info(v));
#endif
}
@ -112,7 +112,7 @@ struct PMO_from_segs {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::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<vertex_info>::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<vertex_info>::access(info(v));
#else
return
*boost::any_cast<vertex_info>(&info(v));
*std::any_cast<vertex_info>(&info(v));
#endif
}
@ -729,8 +729,8 @@ void discard_info(Halfedge_handle e) const
geninfo<halfedge_info>::clear(info(e));
geninfo<halfedge_info>::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<halfedge_info>::access(info(e));
#else
return
*boost::any_cast<halfedge_info>(&info(e));
*std::any_cast<halfedge_info>(&info(e));
#endif
}
@ -782,7 +782,7 @@ void discard_info(Face_handle f) const
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<face_info>::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<face_info>::access(info(f));
#else
return
*boost::any_cast<face_info>(&info(f));
*std::any_cast<face_info>(&info(f));
#endif
}

View File

@ -28,7 +28,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#ifdef CGAL_USE_LEDA_LIBRARY
@ -497,7 +497,7 @@ protected:
return geninfo<VF_pair>::const_access(CT.info(v)).first;
#else
return
boost::any_cast<VF_pair>(CT.info(v)).first;
std::any_cast<VF_pair>(CT.info(v)).first;
#endif
}
@ -507,7 +507,7 @@ protected:
return geninfo<EF_pair>::const_access(CT.info(e)).first;
#else
return
boost::any_cast<EF_pair>(CT.info(e)).first;
std::any_cast<EF_pair>(CT.info(e)).first;
#endif
}
@ -517,7 +517,7 @@ protected:
return geninfo<EF_pair>::const_access(CT.info(e)).second;
#else
return
boost::any_cast<EF_pair>(CT.info(e)).second;
std::any_cast<EF_pair>(CT.info(e)).second;
#endif
}
@ -584,10 +584,10 @@ protected:
f = geninfo<EF_pair>::access(info(e_from)).second;
#else
f =
boost::any_cast<VF_pair>(info(source(e))).second;
std::any_cast<VF_pair>(info(source(e))).second;
else
f =
boost::any_cast<EF_pair>(info(e_from)).second;
std::any_cast<EF_pair>(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<PMD,GEO>::
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<VF_pair>::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<PMD,GEO>::
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<EF_pair>::clear(CT.info(eit));
#else
CT.info(eit)=boost::any();
CT.info(eit)=std::any();
#endif
}
CT.clear();

View File

@ -27,7 +27,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#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<Node>::const_access(value);
#else
return
*boost::any_cast<Node>(&value);
*std::any_cast<Node>(&value);
#endif
}
/*{\Mconversion converts |\Mvar| into a node.\\
@ -105,7 +105,7 @@ public:
return geninfo<Edge>::const_access(value);
#else
return
*boost::any_cast<Edge>(&value);
*std::any_cast<Edge>(&value);
#endif
}
/*{\Mconversion converts |\Mvar| into an edge.\\
@ -159,8 +159,8 @@ public:
case NODE: geninfo<Node>::clear(value); break;
case EDGE: geninfo<Edge>::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<Node>::access(value) = geninfo<Node>::const_access(L.value);
#else
*boost_any_cast<Node>(&value) = boost::any_cast<Node>(L.value);
*boost_any_cast<Node>(&value) = std::any_cast<Node>(L.value);
#endif
break;
case EDGE:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Edge>::access(value) = geninfo<Edge>::const_access(L.value);
#else
*boost::any_cast<Edge>(&value) = boost::any_cast<Edge>(L.value);
*std::any_cast<Edge>(&value) = std::any_cast<Edge>(L.value);
#endif
break;
case NIL: break;

View File

@ -17,7 +17,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/Nef_2/geninfo.h>"
#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 <CGAL/Installation/internal/deprecation_warning.h>
#include <CGAL/config.h>

View File

@ -31,7 +31,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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;

View File

@ -29,7 +29,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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;

View File

@ -30,7 +30,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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;

View File

@ -18,7 +18,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/Nef_2/Segment_overlay_traits.h>
#include <CGAL/Nef_3/SNC_decorator.h>
@ -413,7 +413,7 @@ protected:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
Edge_of[geninfo<unsigned>::access(info(e_min->twin()->source()->twin()->source()))];
#else
Edge_of[ boost::any_cast<unsigned>(info(e_min->twin()->source()->twin()->source())) ];
Edge_of[ std::any_cast<unsigned>(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<unsigned>::access(info(l->incident_sface()->center_vertex()))];
#else
Edge_of[ boost::any_cast<unsigned>(info(l->incident_sface()->center_vertex())) ];
Edge_of[ std::any_cast<unsigned>(info(l->incident_sface()->center_vertex())) ];
#endif
CGAL_assertion( e_below != SHalfedge_handle() );

View File

@ -23,7 +23,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/Nef_S2/Sphere_geometry.h>
#include <CGAL/Nef_S2/SM_decorator.h>

View File

@ -32,7 +32,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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) {}

View File

@ -36,7 +36,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#endif
namespace CGAL {
@ -157,7 +157,7 @@ class SNC_decorator : public SNC_const_decorator<Map> {
#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_() {}

View File

@ -37,7 +37,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#endif
#include <boost/mpl/has_xxx.hpp>
@ -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;

View File

@ -30,7 +30,7 @@
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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;

View File

@ -32,7 +32,7 @@
#define CGAL_NEF_DEBUG 67
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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

View File

@ -31,7 +31,7 @@
#include <CGAL/Unique_hash_map.h>
#include <CGAL/IO/Verbose_ostream.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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;

View File

@ -27,7 +27,7 @@
#include <string>
#include <sstream>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#include <any>
#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;

View File

@ -23,7 +23,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/Nef_S2/Sphere_geometry.h>
#include <CGAL/Nef_S2/SM_decorator.h>
@ -106,7 +106,7 @@ struct SMO_from_segs {
return geninfo<Halfedge_handle>::access(G.info(v));
#else
return
boost::any_cast<Halfedge_handle>( G.info(v) );
std::any_cast<Halfedge_handle>( G.info(v) );
#endif
}
@ -122,7 +122,7 @@ struct SMO_from_segs {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::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<Halfedge_handle>::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<vertex_info>::clear(info(v));
#else
info(v)=boost::any();
info(v)=std::any();
#endif
}
@ -574,7 +574,7 @@ public:
return geninfo<vertex_info>::access(info(v));
#else
return
*boost::any_cast<vertex_info>(&info(v));
*std::any_cast<vertex_info>(&info(v));
#endif
}
@ -618,8 +618,8 @@ public:
geninfo<edge_info>::clear(info(e));
geninfo<edge_info>::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<edge_info>::access(info(e));
#else
return
*boost::any_cast<edge_info>(&info(e));
*std::any_cast<edge_info>(&info(e));
#endif
}
@ -671,7 +671,7 @@ public:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<face_info>::clear(info(f));
#else
info(f)=boost::any();
info(f)=std::any();
#endif
}
@ -681,7 +681,7 @@ public:
return geninfo<face_info>::access(info(f));
#else
return
*boost::any_cast<face_info>(&info(f));
*std::any_cast<face_info>(&info(f));
#endif
}

View File

@ -21,7 +21,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/Nef_2/Object_handle.h>
#include <CGAL/Nef_S2/SM_decorator_traits.h>

View File

@ -22,7 +22,7 @@
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#include <any>
#endif
#include <CGAL/Nef_S2/SM_decorator.h>
#include <CGAL/Nef_S2/SM_const_decorator.h>
@ -213,7 +213,7 @@ public:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::clear(info(v));
#else
info(v)=boost::any();
info(v)=std::any();
#endif
}
@ -223,7 +223,7 @@ public:
return geninfo<vertex_info>::access(info(v));
#else
return
*boost::any_cast<vertex_info>(&info(v));
*std::any_cast<vertex_info>(&info(v));
#endif
}
@ -258,8 +258,8 @@ public:
geninfo<edge_info>::clear(info(e));
geninfo<edge_info>::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<edge_info>::access(info(e));
#else
return
*boost::any_cast<edge_info>(&info(e));
*std::any_cast<edge_info>(&info(e));
#endif
}
@ -288,7 +288,7 @@ public:
return geninfo<edge_info>::const_access(info(e));
#else
return
*boost::any_cast<edge_info>(&info(e));
*std::any_cast<edge_info>(&info(e));
#endif
}
const Mark& incident_mark(SHalfedge_const_handle e) const

View File

@ -43,7 +43,7 @@
#include <tbb/blocked_range.h>
#endif // CGAL_LINKED_WITH_TBB
#include <boost/any.hpp>
#include <any>
#include <unordered_set>
#include <algorithm>
@ -1818,10 +1818,10 @@ struct Bounded_error_preprocessing
#ifdef CGAL_HAUSDORFF_DEBUG
using Timer = CGAL::Real_timer;
#endif
std::vector<boost::any>& tm_wrappers;
std::vector<std::any>& tm_wrappers;
// Constructor.
Bounded_error_preprocessing(std::vector<boost::any>& tm_wrappers)
Bounded_error_preprocessing(std::vector<std::any>& 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<std::size_t>& 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<TM1Wrapper&>(tm_wrapper);
TM1Wrapper& object = std::any_cast<TM1Wrapper&>(tm_wrapper);
object.build_tree();
}
else if(is_tm2_wrapper(tm_wrapper))
{
TM2Wrapper& object = boost::any_cast<TM2Wrapper&>(tm_wrapper);
TM2Wrapper& object = std::any_cast<TM2Wrapper&>(tm_wrapper);
object.build_tree();
}
else
@ -2031,7 +2031,7 @@ bounded_error_squared_one_sided_Hausdorff_distance_impl(const TriangleMesh1& tm1
std::vector<TMF> tm1_parts;
std::vector<TMF_tree> tm1_trees;
std::vector<boost::any> tm_wrappers;
std::vector<std::any> tm_wrappers;
#endif // defined(CGAL_LINKED_WITH_TBB) && defined(CGAL_METIS_ENABLED)
#ifdef CGAL_HAUSDORFF_DEBUG

View File

@ -34,7 +34,7 @@
#include <CGAL/make_mesh_3.h> // for C3t3_initializer
#include <CGAL/use.h>
#include <boost/any.hpp>
#include <any>
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<Mesh_sizing_field>(sizing_field_ptr),
QSharedPointer<Patches_ids_vector>(patches_ids_vector_p));

View File

@ -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}

View File

@ -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

View File

@ -29,20 +29,20 @@
#include <boost/variant.hpp>
#include <optional>
#include <boost/any.hpp>
#include <any>
#include <memory>
namespace CGAL {
class Object
{
std::shared_ptr<boost::any> obj;
std::shared_ptr<std::any> obj;
// returns an any pointer from a variant
struct Any_from_variant : public boost::static_visitor<boost::any*> {
struct Any_from_variant : public boost::static_visitor<std::any*> {
template<typename T>
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 <class T>
Object(T && t, private_tag) : obj(new boost::any(std::forward<T>(t))) { }
Object(T && t, private_tag) : obj(new std::any(std::forward<T>(t))) { }
// implicit constructor from optionals containing variants
template<BOOST_VARIANT_ENUM_PARAMS(typename T)>
@ -76,7 +76,7 @@ class Object
template <class T>
bool assign(T &t) const
{
const T* res = boost::any_cast<T>(obj.get());
const T* res = std::any_cast<T>(obj.get());
if (!res) return false;
t = *res;
return true;
@ -105,7 +105,7 @@ class Object
template <class T>
bool is() const
{
return obj && boost::any_cast<T>(obj.get());
return obj && std::any_cast<T>(obj.get());
}
const std::type_info & type() const
@ -159,14 +159,14 @@ template <class T>
inline
const T * object_cast(const Object * o)
{
return boost::any_cast<T>((o->obj).get());
return std::any_cast<T>((o->obj).get());
}
template <class T>
inline
T object_cast(const Object & o)
{
const T * result = boost::any_cast<T>((o.obj).get());
const T * result = std::any_cast<T>((o.obj).get());
if (!result)
throw Bad_object_cast();
return *result;