Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace boost by std #7403

Merged
merged 42 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fc034c6
boost::unit -> std::uint
sloriot Apr 23, 2023
99e7f48
boost::int -> std::int
sloriot Apr 23, 2023
5a8736d
fix typo
sloriot Apr 23, 2023
61834d5
boost::remove_const -> std::remove_const_t
sloriot Apr 23, 2023
fa30155
boost::remove_v -> std::remove_cv_t
sloriot Apr 23, 2023
8b3acae
boost::remove_reference -> std::remove_reference
sloriot Apr 23, 2023
b99c384
boost::remove_pointer -> std::remove_pointer
sloriot Apr 23, 2023
7b85df8
boost::add_const -> std::add_const
sloriot Apr 23, 2023
a88af6c
boost::array -> std::array
sloriot Apr 23, 2023
b857179
remove extra namespace
sloriot Apr 23, 2023
99619dc
boost::prior -> std::prev
sloriot Apr 23, 2023
e82d970
boost::next -> std::next
sloriot Apr 23, 2023
9ed6c7a
remove useless include
sloriot Apr 23, 2023
8e29e70
factorize constructor
sloriot Apr 23, 2023
8740b24
boost::distance -> std::distance
sloriot Apr 23, 2023
390cccf
boost::is_empty -> std::is_empty
sloriot Apr 23, 2023
6fd9476
boost::is_integral -> std::is_integral
sloriot Apr 23, 2023
d4d2225
boost::is_reference -> std::is_reference
sloriot Apr 23, 2023
a1b2dd0
boost::is_pointer -> std::is_pointer
sloriot Apr 23, 2023
a040358
boost::is_const -> std::is_const
sloriot Apr 23, 2023
5726a0a
boost::is_floating_point -> std::is_floating_point
sloriot Apr 23, 2023
32340e6
boost::is_arithmetic -> std::is_arithmetic
sloriot Apr 23, 2023
b039040
boost::is_convertible -> std::is_convertible
sloriot Apr 23, 2023
cf45dd3
boost::is_base_of -> std::is_base_of
sloriot Apr 23, 2023
633ec73
fonctor -> functor
sloriot Apr 23, 2023
ea62c31
boost::lambda -> c++11 lambda
sloriot Apr 23, 2023
2f7d150
boost::begin/end/empty/size -> std::begin/end/empty/size
sloriot Apr 23, 2023
d9e9c1e
dtd::disance does not handle ranges
sloriot Apr 23, 2023
4fb4ca2
std::empty needs c++17
sloriot Apr 28, 2023
af337ed
boost::reference_wrapper ---> std::reference_wrapper
sloriot Apr 29, 2023
769fca3
std::size is also c++17
sloriot Apr 29, 2023
c1294a0
boost::integral_constant ---> std::integral_constant
sloriot Apr 29, 2023
11a5b39
use Range::size()
sloriot Jun 15, 2023
f936680
Merge remote-tracking branch 'cgal/master' into HEAD
sloriot Jun 15, 2023
dfc386d
Merge branch 'master' into HEAD
sloriot Jun 22, 2023
4854c50
restore usage of boost prior/next that breaks at runtime
sloriot Jun 26, 2023
04f5279
manually fix iterator category that seems to not work correctly when …
sloriot Jun 27, 2023
61ec729
The category is just bidirectional when the reference IS a reference,…
afabri Jun 27, 2023
be83ab8
Undo of accidental change
afabri Jun 27, 2023
46b756d
We know that it is bidirectional, and we prefer that to using const V…
afabri Jun 27, 2023
c7eb4f9
Deal with prev() for graph_traits<T2>::iterator
afabri Jun 27, 2023
8bc01b1
add missing include
sloriot Jun 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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