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::mpl #7813

Merged
merged 9 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 4 additions & 5 deletions AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <CGAL/AABB_primitive.h>
#include <CGAL/boost/graph/property_maps.h>
#include <CGAL/Default.h>
#include <boost/mpl/if.hpp>

namespace CGAL {

Expand Down Expand Up @@ -57,9 +56,9 @@ template < class FaceGraph,
class CacheDatum=Tag_false >
class AABB_face_graph_triangle_primitive
#ifndef DOXYGEN_RUNNING
: public AABB_primitive<typename boost::mpl::if_<OneFaceGraphPerTree,
typename boost::graph_traits<FaceGraph>::face_descriptor,
std::pair<typename boost::graph_traits<FaceGraph>::face_descriptor, const FaceGraph*> >::type,
: public AABB_primitive<std::conditional_t<OneFaceGraphPerTree::value,
typename boost::graph_traits<FaceGraph>::face_descriptor,
std::pair<typename boost::graph_traits<FaceGraph>::face_descriptor, const FaceGraph*> >,
Triangle_from_face_descriptor_map<
FaceGraph,
typename Default::Get<VertexPointPMap,
Expand All @@ -76,7 +75,7 @@ class AABB_face_graph_triangle_primitive
{
typedef typename Default::Get<VertexPointPMap, typename boost::property_map< FaceGraph, vertex_point_t>::const_type >::type VertexPointPMap_;
typedef typename boost::graph_traits<FaceGraph>::face_descriptor FD;
typedef typename boost::mpl::if_<OneFaceGraphPerTree, FD, std::pair<FD, const FaceGraph*> >::type Id_;
typedef std::conditional_t<OneFaceGraphPerTree::value, FD, std::pair<FD, const FaceGraph*> > Id_;

typedef Triangle_from_face_descriptor_map<FaceGraph,VertexPointPMap_> Triangle_property_map;
typedef One_point_from_face_descriptor_map<FaceGraph,VertexPointPMap_> Point_property_map;
Expand Down
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/mpl/if.hpp>

#include <CGAL/Default.h>

Expand Down Expand Up @@ -70,9 +69,9 @@ template < class HalfedgeGraph,
class CacheDatum = Tag_false >
class AABB_halfedge_graph_segment_primitive
#ifndef DOXYGEN_RUNNING
: public AABB_primitive< typename boost::mpl::if_<OneHalfedgeGraphPerTree,
typename boost::graph_traits<HalfedgeGraph>::edge_descriptor,
std::pair<typename boost::graph_traits<HalfedgeGraph>::edge_descriptor, const HalfedgeGraph*> >::type,
: public AABB_primitive< std::conditional_t<OneHalfedgeGraphPerTree::value,
typename boost::graph_traits<HalfedgeGraph>::edge_descriptor,
std::pair<typename boost::graph_traits<HalfedgeGraph>::edge_descriptor, const HalfedgeGraph*> >,
Segment_from_edge_descriptor_map<
HalfedgeGraph,
typename Default::Get<VertexPointPMap,
Expand All @@ -89,7 +88,7 @@ class AABB_halfedge_graph_segment_primitive
{
typedef typename Default::Get<VertexPointPMap,typename boost::property_map< HalfedgeGraph,vertex_point_t>::const_type >::type VertexPointPMap_;
typedef typename boost::graph_traits<HalfedgeGraph>::edge_descriptor ED;
typedef typename boost::mpl::if_<OneHalfedgeGraphPerTree, ED, std::pair<ED, const HalfedgeGraph*> >::type Id_;
typedef std::conditional_t<OneHalfedgeGraphPerTree::value, ED, std::pair<ED, const HalfedgeGraph*> > Id_;

typedef Segment_from_edge_descriptor_map<HalfedgeGraph,VertexPointPMap_> Segment_property_map;
typedef Source_point_from_edge_descriptor_map<HalfedgeGraph,VertexPointPMap_> Point_property_map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_cartesian_const_iterator_3,Cartesian_const

template<typename GeomTraits>
struct Is_ray_intersection_geomtraits
: boost::mpl::and_< Has_ray_3<GeomTraits>,
Has_construct_source_3<GeomTraits>,
Has_vector_3<GeomTraits>,
Has_construct_cartesian_const_iterator_3<GeomTraits>,
Has_cartesian_const_iterator_3<GeomTraits> >::type
: std::bool_constant< Has_ray_3<GeomTraits>::value &&
Has_construct_source_3<GeomTraits>::value &&
Has_vector_3<GeomTraits>::value &&
Has_construct_cartesian_const_iterator_3<GeomTraits>::value &&
Has_cartesian_const_iterator_3<GeomTraits>::value >
{};


Expand Down
16 changes: 8 additions & 8 deletions Algebraic_foundations/include/CGAL/number_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,21 @@ root_of( int k, Input_iterator begin, Input_iterator end ) {
template< class Number_type >
inline
// select a Is_zero functor
typename boost::mpl::if_c<
::std::is_same< typename Algebraic_structure_traits< Number_type >::Is_zero,
Null_functor >::value ,
typename std::conditional_t<
std::is_same_v< typename Algebraic_structure_traits< Number_type >::Is_zero,
Null_functor >,
typename Real_embeddable_traits< Number_type >::Is_zero,
typename Algebraic_structure_traits< Number_type >::Is_zero
>::type::result_type
>::result_type
is_zero( const Number_type& x ) {
// We take the Algebraic_structure_traits<>::Is_zero functor by default. If it
// is not available, we take the Real_embeddable_traits functor
typename ::boost::mpl::if_c<
::std::is_same<
std::conditional_t<
std::is_same_v<
typename Algebraic_structure_traits< Number_type >::Is_zero,
Null_functor >::value ,
Null_functor > ,
typename Real_embeddable_traits< Number_type >::Is_zero,
typename Algebraic_structure_traits< Number_type >::Is_zero >::type
typename Algebraic_structure_traits< Number_type >::Is_zero >
is_zero;
return is_zero( x );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <CGAL/Surface_sweep_2/Arr_batched_pl_ss_visitor.h>

#include <vector>
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>

namespace CGAL {
Expand Down Expand Up @@ -120,7 +119,7 @@ locate(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).
*/
typename boost::mpl::if_<std::is_same<Gt2, Bgt2>, const Bgt2&, Bgt2>::type
std::conditional_t<std::is_same_v<Gt2, Bgt2>, const Bgt2&, Bgt2>
ex_traits(*geom_traits);

// Define the sweep-line visitor and perform the sweep.
Expand Down
5 changes: 2 additions & 3 deletions Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include <vector>
#include <optional>
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits.hpp>

Expand Down Expand Up @@ -247,8 +246,8 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
* only an implicit constructor, (which takes *b as a parameter).
*/
typename boost::mpl::if_<std::is_same<Gt_adaptor_2, Ovl_gt2>,
const Ovl_gt2&, Ovl_gt2>::type
std::conditional_t<std::is_same_v<Gt_adaptor_2, Ovl_gt2>,
const Ovl_gt2&, Ovl_gt2>
ex_traits(*traits_adaptor);

Ovl_visitor visitor(&arr1, &arr2, &arr, &ovl_tr);
Expand Down
Loading