Skip to content

Commit

Permalink
Merge pull request #7403 from sloriot/CGAL-replace_boost_by_std
Browse files Browse the repository at this point in the history
Replace boost by std
  • Loading branch information
sloriot committed Jun 22, 2023
2 parents 31f3cae + e80e05b commit b36bf0a
Show file tree
Hide file tree
Showing 211 changed files with 1,627 additions and 1,054 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <iterator>
#include <boost/mpl/and.hpp>
#include <CGAL/type_traits/is_iterator.h>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/mpl/if.hpp>

#include <CGAL/Default.h>
Expand Down
5 changes: 2 additions & 3 deletions AABB_tree/include/CGAL/AABB_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
#include <boost/optional.hpp>
#include <boost/lambda/lambda.hpp>

#ifdef CGAL_HAS_THREADS
#include <CGAL/mutex.h>
Expand Down Expand Up @@ -326,7 +325,7 @@ namespace CGAL {
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
first_intersection(const Ray& query) const
{
return first_intersection(query, boost::lambda::constant(false));
return first_intersection(query, [](Primitive_id){ return false; });
}
/// \endcond

Expand All @@ -351,7 +350,7 @@ namespace CGAL {
boost::optional<Primitive_id>
first_intersected_primitive(const Ray& query) const
{
return first_intersected_primitive(query, boost::lambda::constant(false));
return first_intersected_primitive(query, [](Primitive_id){ return false; });
}
/// \endcond
///@}
Expand Down
1 change: 0 additions & 1 deletion AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <iterator>

#include <boost/functional/value_factory.hpp>
#include <boost/array.hpp>

#include <CGAL/algorithm.h>
#include <CGAL/point_generators_3.h>
Expand Down
3 changes: 1 addition & 2 deletions AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <iterator>

#include <boost/functional/value_factory.hpp>
#include <boost/array.hpp>

#include <CGAL/assertions.h>
#include <CGAL/algorithm.h>
Expand Down Expand Up @@ -92,7 +91,7 @@ int main()
Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2,
(bbox.ymin() + bbox.ymax()) / 2,
(bbox.zmin() + bbox.zmax()) / 2);
boost::array<double, 3> extents;
std::array<double, 3> extents;
extents[0] = bbox.xmax() - bbox.xmin();
extents[1] = bbox.ymax() - bbox.ymin();
extents[2] = bbox.zmax() - bbox.zmin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,8 @@ class Test_is_square {
CGAL_USE_TYPE(First_argument_type);
CGAL_USE_TYPE(Second_argument_type);

static_assert(
( ::std::is_same< AS , First_argument_type>::value));
static_assert(
( ::std::is_same< AS& , Second_argument_type>::value));
static_assert(::std::is_same< AS , First_argument_type>::value);
static_assert(::std::is_same< AS& , Second_argument_type>::value);
//static_assert(::std::is_same< bool , Result_type>::value);
bool b = Result_type(true); CGAL_USE(b);

Expand Down Expand Up @@ -674,12 +672,9 @@ class Test_root {
CGAL_USE_TYPE(First_argument_type);
CGAL_USE_TYPE(Second_argument_type);
CGAL_USE_TYPE(Result_type);
static_assert(
( ::std::is_same<int, First_argument_type>::value));
static_assert(
( ::std::is_same< AS , Second_argument_type>::value));
static_assert(
( ::std::is_same< AS , Result_type>::value));
static_assert(::std::is_same<int, First_argument_type>::value);
static_assert(::std::is_same< AS , Second_argument_type>::value);
static_assert(::std::is_same< AS , Result_type>::value);
AS epsilon(1);
assert( test_equality_epsilon( AS (2),
root( 4, AS (16) ), epsilon ) );
Expand Down Expand Up @@ -821,6 +816,7 @@ void test_algebraic_structure(){
static_assert(::std::is_same< Tag, Algebraic_category>::value);
static_assert(!::std::is_same< Simplify, Null_functor>::value);
static_assert(!::std::is_same< Unit_part, Null_functor>::value);

const Simplify simplify=Simplify();;
const Unit_part unit_part= Unit_part();

Expand Down Expand Up @@ -940,8 +936,7 @@ void test_algebraic_structure( const AS & a, const AS & b, const AS & c) {

typedef CGAL::Algebraic_structure_traits<AS> AST;
typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive;
static_assert(
!(::std::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value));
static_assert(!::std::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value);
CGAL_USE_TYPE(Is_numerical_sensitive);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <type_traits>

#include <boost/mpl/has_xxx.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/logical.hpp>

Expand Down Expand Up @@ -66,14 +65,14 @@ namespace internal {

template<typename Comparable,bool has_template_typedefs>
struct Is_derived_from_Handle_with_policy {
typedef boost::false_type Tag;
typedef std::false_type Tag;
};

template<typename Comparable>
struct Is_derived_from_Handle_with_policy<Comparable,true> {

typedef typename
boost::is_base_of< CGAL::Handle_with_policy
std::is_base_of< CGAL::Handle_with_policy
< typename Comparable::T,
typename Comparable::Handle_policy,
typename Comparable::Allocator >,
Expand All @@ -90,7 +89,7 @@ template<typename Comparable,typename Tag> struct Compare_for_vert_line_map_
};

template<typename Comparable>
struct Compare_for_vert_line_map_<Comparable,boost::true_type> {
struct Compare_for_vert_line_map_<Comparable,std::true_type> {

bool operator() (const Comparable& a, const Comparable& b) const {
return CGAL::Handle_id_less_than< Comparable >()(a,b);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ struct Alpha_nt_selector_2
GeomTraits,
// If the base traits is already exact then we don't need to do anything,
// and we can simply directly use the traits class
Boolean_tag<boost::is_floating_point<typename GeomTraits::FT>::value &&
Boolean_tag<std::is_floating_point<typename GeomTraits::FT>::value &&
ExactAlphaComparisonTag::value >,
Weighted_tag>
{ };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ struct Alpha_nt_selector_3
GeomTraits,
// If the base traits is already exact then we don't need to do anything,
// and we can simply directly use the traits class
Boolean_tag<boost::is_floating_point<typename GeomTraits::FT>::value &&
Boolean_tag<std::is_floating_point<typename GeomTraits::FT>::value &&
ExactAlphaComparisonTag::value >,
Weighted_tag>
{ };
Expand Down
3 changes: 1 addition & 2 deletions Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <utility>
#include <iostream>
#include <queue>
#include <boost/next_prior.hpp>

#include <CGAL/Triangulation_utils_3.h>
#include <CGAL/Unique_hash_map.h>
Expand Down Expand Up @@ -255,7 +254,7 @@ class Fixed_alpha_shape_3 : public Dt
std::back_inserter(cells),
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,
// as they will be deleted during the insertion.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ namespace CGAL {
//typedef const result_type& qualified_result_type;

template < typename T >
//typename boost::remove_reference<qualified_result_type>::type
//std::remove_reference_t<qualified_result_type>
Circular_arc_point_2
operator()(const T &a) const
{
Expand All @@ -370,7 +370,7 @@ namespace CGAL {
typedef Point_2 result_type;
//typedef const result_type& qualified_result_type;

//typename boost::remove_reference<qualified_result_type>::type
//std::remove_reference_t<qualified_result_type>
result_type
operator() (const boost::variant< Arc1, Arc2 > & cv) const
{
Expand All @@ -397,7 +397,7 @@ namespace CGAL {
//typedef const result_type& qualified_result_type;

template < typename T >
//typename boost::remove_reference<qualified_result_type>::type
//std::remove_reference_t<qualified_result_type>
Circular_arc_point_2
operator()(const T &a) const
{
Expand All @@ -420,7 +420,7 @@ namespace CGAL {
typedef Point_2 result_type;
//typedef const result_type& qualified_result_type;

//typename boost::remove_reference<qualified_result_type>::type
//std::remove_reference<qualified_result_type>
result_type
operator() (const boost::variant< Arc1, Arc2 > & cv) const
{
Expand Down
2 changes: 1 addition & 1 deletion Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Arr_conic_traits_2 {
typedef Tag_true Has_left_category;
typedef Tag_true Has_merge_category;
typedef Tag_false Has_do_intersect_category;
//typedef boost::true_type Has_line_segment_constructor;
//typedef std::true_type Has_line_segment_constructor;

typedef Arr_oblivious_side_tag Left_side_category;
typedef Arr_oblivious_side_tag Bottom_side_category;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
typedef Arr_contracted_side_tag Top_side_category;
typedef Arr_identified_side_tag Right_side_category;

typedef boost::integral_constant<bool, atan_y==0> Zero_atan_y;
typedef std::integral_constant<bool, atan_y==0> Zero_atan_y;

// Traits objects
typedef Arr_extended_direction_3<Kernel> Point_2;
Expand Down Expand Up @@ -358,7 +358,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
*/
void intersection_with_identification(const X_monotone_curve_2& xcv,
Direction_3& dp,
boost::true_type) const
std::true_type) const
{
const Direction_3& normal = xcv.normal();
dp = (CGAL::sign(normal.dz()) == POSITIVE) ?
Expand All @@ -371,7 +371,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
*/
void intersection_with_identification(const X_monotone_curve_2& xcv,
Direction_3& dp,
boost::false_type) const
std::false_type) const
{
const Direction_3& normal = xcv.normal();
FT z((atan_x * normal.dx() + atan_y * normal.dy()) /
Expand All @@ -383,7 +383,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
* \param[in] cv the curve
*/
bool overlap_with_identification(const X_monotone_curve_2& xcv,
boost::true_type) const
std::true_type) const
{
const Direction_3& normal = xcv.normal();
return ((x_sign(normal) == ZERO) &&
Expand All @@ -395,7 +395,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
* \param[in] cv the curve
*/
bool overlap_with_identification(const X_monotone_curve_2& xcv,
boost::false_type) const
std::false_type) const
{
const Direction_3& normal = xcv.normal();
const Direction_3& iden_normal = identification_normal();
Expand Down Expand Up @@ -441,7 +441,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
Point_2 p;
Direction_3& d(p);
d = Direction_3(x, y, z);
init(p, boost::integral_constant<bool, atan_y==0>());
init(p, std::integral_constant<bool, atan_y==0>());
return p;
}

Expand All @@ -454,14 +454,14 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
Point_2 p;
Direction_3& d(p);
d = Direction_3(other);
init(p, boost::integral_constant<bool, atan_y==0>());
init(p, std::integral_constant<bool, atan_y==0>());
return p;
}

/*! Initialize a point on the sphere,
* \param[in] p the point to initialize.
*/
void init(Point_2& p, boost::true_type) const
void init(Point_2& p, std::true_type) const
{
const Direction_3& dir = p;
if (y_sign(dir) != ZERO) {
Expand All @@ -480,7 +480,7 @@ class Arr_geodesic_arc_on_sphere_traits_2 : public Kernel_ {
/*! Initialize a point on the sphere,
* \param[in] p the point to initialize.
*/
void init(Point_2& p, boost::false_type) const
void init(Point_2& p, std::false_type) const
{
const Direction_3& dir = p;
if ((x_sign(dir) == ZERO) && (y_sign(dir) == ZERO)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Ss2 = Surface_sweep_2;
// The last parameter is used to resolve ambiguity between this function and
// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and
// Curve_2 are the same class.
// The last parameter should be boost::false_type but we used a
// The last parameter should be std::false_type but we used a
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
//
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
Expand Down Expand Up @@ -132,7 +132,7 @@ void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
//
// The last parameter is used to resolve ambiguity between this function and
// do_intersect of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the
// same class. The last parameter should be boost::true_type but we used a
// same class. The last parameter should be std::true_type but we used a
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
//
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
Expand Down Expand Up @@ -406,7 +406,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
// The last parameter is used to resolve ambiguity between this function and
// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and
// Curve_2 are the same class.
// The last parameter should be boost::false_type but we used a
// The last parameter should be std::false_type but we used a
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
//
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
Expand Down Expand Up @@ -460,7 +460,7 @@ void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
//
// The last parameter is used to resolve ambiguity between this function and
// insert of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the
// same class. The last parameter should be boost::true_type but we used a
// same class. The last parameter should be std::true_type but we used a
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
//
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
Expand Down Expand Up @@ -1522,7 +1522,7 @@ zone(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
// Checks whether the given x-monotone curve intersects the existing arrangement.
// The last parameter is used to resolve ambiguity between this function and
// do_intersect of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the
// same class. The last parameter should be boost::true_type but we used a
// same class. The last parameter should be std::true_type but we used a
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
//
// error: no matching function for call to `do_intersect(Arrangement_on_surface_2<>&,
Expand Down Expand Up @@ -1559,7 +1559,7 @@ do_intersect(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
// The last parameter is used to resolve ambiguity between this function and
// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and
// Curve_2 are the same class.
// The last parameter should be boost::false_type but we used a
// The last parameter should be std::false_type but we used a
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
//
// error: no matching function for call to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <CGAL/license/Arrangement_on_surface_2.h>


#include <boost/type_traits/integral_constant.hpp>
#include <type_traits>

namespace CGAL
{
Expand Down Expand Up @@ -62,7 +62,7 @@ namespace CGAL

// In the meanwhile we use a default implementation.
template <class T>
class is_arrangement_2 : public boost::false_type
class is_arrangement_2 : public std::false_type
{};

//-------------------------------- Arrangement_2
Expand All @@ -74,7 +74,7 @@ class Arrangement_2;
template <class GeomTraits_, class DCEL_>
class is_arrangement_2<
Arrangement_2<GeomTraits_, DCEL_>
> : public boost::false_type
> : public std::false_type
{};


Expand All @@ -87,7 +87,7 @@ class Arrangement_on_surface_2;
template <class GeomTraits_, class TopTraits_>
class is_arrangement_2<
Arrangement_on_surface_2<GeomTraits_, TopTraits_>
> : public boost::true_type
> : public std::true_type
{};

} // namespace CGAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include <CGAL/Bbox_2.h>
#include <CGAL/Arithmetic_kernel.h>

#include <boost/array.hpp>
#include <CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h>


Expand Down
Loading

0 comments on commit b36bf0a

Please sign in to comment.