From 70a06b46964fabfa5ef590b500898a4c65c8821a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 27 Jun 2022 08:58:17 +0100 Subject: [PATCH] Do not use CGAL::iterator_v<> as it is responsible for the ICE of VC2015 --- .../include/CGAL/Boolean_set_operations_2/intersection.h | 2 +- Convex_hull_3/include/CGAL/convex_hull_3.h | 6 +++--- .../include/CGAL/natural_neighbor_coordinates_2.h | 2 +- .../include/CGAL/regular_neighbor_coordinates_2.h | 8 ++++---- .../include/CGAL/Mesh_3/experimental/Facet_patch_id_map.h | 2 +- NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h | 4 ++-- Point_set_processing_3/include/CGAL/IO/read_las_points.h | 2 +- Point_set_processing_3/include/CGAL/IO/read_off_points.h | 8 ++++---- Point_set_processing_3/include/CGAL/IO/read_ply_points.h | 8 ++++---- Point_set_processing_3/include/CGAL/IO/read_xyz_points.h | 2 +- Principal_component_analysis_LGPL/include/CGAL/centroid.h | 8 ++++---- Stream_support/include/CGAL/IO/PLY.h | 2 +- Stream_support/include/CGAL/IO/PLY/PLY_reader.h | 8 +------- .../include/CGAL/Constrained_Delaunay_triangulation_2.h | 2 +- 14 files changed, 29 insertions(+), 35 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h index ad0fc8b1ee9..1c6ee9aef48 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/intersection.h @@ -286,7 +286,7 @@ inline OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi, unsigned int k=5, // workaround to avoid ambiguous calls with kernel functions - std::enable_if_t>* = 0, + std::enable_if_t:value>* = 0, Disable_if_Polygon_2_iterator* = 0) { typename Iterator_to_gps_traits::Traits traits; diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 14ac3ef0eb7..46d2082ab0b 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -1053,7 +1053,7 @@ template void convex_hull_3(InputIterator first, InputIterator beyond, PolygonMesh& polyhedron, // workaround to avoid ambiguity with next overload. - std::enable_if_t>* = 0) + std::enable_if_t::value>* = 0) { typedef typename std::iterator_traits::value_type Point_3; typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3::type Traits; @@ -1084,7 +1084,7 @@ template void convex_hull_3(InputIterator first, InputIterator beyond, PointRange& vertices, TriangleRange& faces, - std::enable_if_t>* = 0, + std::enable_if_t::value>* = 0, std::enable_if_t::value>* = 0, std::enable_if_t::value>* = 0) { @@ -1101,7 +1101,7 @@ void convex_hull_3(InputIterator first, InputIterator beyond, PointRange& vertices, TriangleRange& faces, const Traits& traits, - std::enable_if_t>* = 0, + std::enable_if_t::value>* = 0, std::enable_if_t::value>* = 0, std::enable_if_t::value>* = 0) { diff --git a/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h b/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h index d50116d0938..da70606c4ac 100644 --- a/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h @@ -254,7 +254,7 @@ natural_neighbor_coordinates_2(const Dt& dt, OutputFunctor fct, typename Dt::Face_handle start = CGAL_TYPENAME_DEFAULT_ARG Dt::Face_handle(), std::enable_if_t< - !is_iterator_v + !is_iterator::value >* = 0) { CGAL_precondition(dt.dimension() == 2); diff --git a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h index 050e86d7fa0..0e18ed8baaf 100644 --- a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h @@ -308,7 +308,7 @@ regular_neighbor_coordinates_2(const Rt& rt, OutputIteratorVorVertices vor_vertices, typename Rt::Face_handle start, std::enable_if_t< - is_iterator_v + is_iterator::value >* = 0) { // Same as above but without OutputFunctor. Default to extracting the point, for backward compatibility. @@ -328,7 +328,7 @@ regular_neighbor_coordinates_2(const Rt& rt, OutputFunctor fct, typename Rt::Face_handle start, std::enable_if_t< - !is_iterator_v + !is_iterator::value >* = 0) { return regular_neighbor_coordinates_2(rt, p, out, fct, Emptyset_iterator(), start); @@ -425,7 +425,7 @@ regular_neighbor_coordinates_2(const Rt& rt, VertexIterator hidden_vertices_begin, VertexIterator hidden_vertices_end, std::enable_if_t< - !is_iterator_v + !is_iterator::value >* = 0) { return regular_neighbor_coordinates_2(rt, p, out, fct, Emptyset_iterator(), @@ -448,7 +448,7 @@ regular_neighbor_coordinates_2(const Rt& rt, VertexIterator hidden_vertices_begin, VertexIterator hidden_vertices_end, std::enable_if_t< - is_iterator_v + is_iterator::value >* = 0) { typedef typename Rt::Geom_traits::FT FT; diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Facet_patch_id_map.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Facet_patch_id_map.h index bafbeceace6..3c2fe701f47 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Facet_patch_id_map.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Facet_patch_id_map.h @@ -26,7 +26,7 @@ namespace CGAL { namespace Mesh_3 { /// retrieve the patch_id() of the facet. template > + bool id_is_iterator = CGAL::is_iterator::value > struct Facet_patch_id_map; // Primitive::Id is an iterator type diff --git a/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h b/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h index c1385eb98f7..09ed5664c46 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h @@ -135,7 +135,7 @@ typename typeset_intersection(a),Store_kernel2(b){} // For the (not anymore used in CGAL) boost result of, used in transforming_iterator - template?42:0> struct result:Base::template result{}; + template::value?42:0> struct result:Base::template result{}; template struct result { typedef transforming_iterator type; }; @@ -160,7 +160,7 @@ typename typeset_intersection - transforming_iterator,It>> + transforming_iterator::value,It>> operator()(It const& it) const { return make_transforming_iterator(it,*this); } diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 4d0d99a7eb5..0fafe579ba8 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -476,7 +476,7 @@ bool read_LAS(std::istream& is, template bool read_LAS(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { return read_LAS::type>(is, output, np); } diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index f91dc45fbc0..e50db48ca36 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -82,7 +82,7 @@ bool read_OFF(std::istream& is, PointOutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values() #ifndef DOXYGEN_RUNNING - , std::enable_if_t>* = nullptr + , std::enable_if_t::value>* = nullptr #endif ) { @@ -244,7 +244,7 @@ bool read_OFF(const std::string& fname, PointOutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values() #ifndef DOXYGEN_RUNNING - , std::enable_if_t>* = nullptr + , std::enable_if_t::value>* = nullptr #endif ) { @@ -258,14 +258,14 @@ bool read_OFF(const std::string& fname, template bool read_OFF(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { return read_OFF::type>(is, output, np); } template bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { std::ifstream is(fname); return read_OFF::type>(is, output, np); diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index c1bb0c3cff6..5ecedc40b68 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -244,7 +244,7 @@ bool read_PLY(std::istream& is, PointOutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values() #ifndef DOXYGEN_RUNNING - , std::enable_if_t>* = nullptr + , std::enable_if_t::value>* = nullptr #endif ) { @@ -326,7 +326,7 @@ bool read_PLY(const std::string& fname, PointOutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values() #ifndef DOXYGEN_RUNNING - , std::enable_if_t>* = nullptr + , std::enable_if_t::value>* = nullptr #endif ) { @@ -350,14 +350,14 @@ bool read_PLY(const std::string& fname, // variants with default output iterator value type template bool read_PLY(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { return read_PLY::type>(is, output, np); } template bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { return read_PLY::type>(fname, output, np); } diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index 7521550be66..a420f5068b7 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -237,7 +237,7 @@ bool read_XYZ(const std::string& fname, // variants with default output iterator value type template bool read_XYZ(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { return read_XYZ::type>(is, output, np); } diff --git a/Principal_component_analysis_LGPL/include/CGAL/centroid.h b/Principal_component_analysis_LGPL/include/CGAL/centroid.h index b02a618a639..aa8fad6136a 100644 --- a/Principal_component_analysis_LGPL/include/CGAL/centroid.h +++ b/Principal_component_analysis_LGPL/include/CGAL/centroid.h @@ -823,7 +823,7 @@ struct Dispatch_centroid_3 template < typename InputIterator, typename K> typename internal::Dispatch_centroid_3< - std::enable_if_t,InputIterator>, + std::enable_if_t::value,InputIterator>, K,Dynamic_dimension_tag>::result_type centroid(InputIterator begin, InputIterator end, const K& k, Dynamic_dimension_tag tag) { @@ -832,7 +832,7 @@ centroid(InputIterator begin, InputIterator end, const K& k, Dynamic_dimension_t template < typename InputIterator, typename K, int d > typename internal::Dispatch_centroid_3< - std::enable_if_t,InputIterator>, + std::enable_if_t::value,InputIterator>, K,Dimension_tag >::result_type centroid(InputIterator begin, InputIterator end, const K& k, Dimension_tag tag) { @@ -897,7 +897,7 @@ struct Dispatch_centroid template < typename InputIterator, typename Kernel_or_dim > inline typename internal::Dispatch_centroid< - std::enable_if_t,InputIterator>, + std::enable_if_t::value,InputIterator>, Kernel_or_dim>::result_type centroid(InputIterator begin, InputIterator end, const Kernel_or_dim& k_or_d) { @@ -906,7 +906,7 @@ centroid(InputIterator begin, InputIterator end, const Kernel_or_dim& k_or_d) } namespace internal { -template> + template::value> class Centroid_2args_return_type_helper{}; template diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index de33964847f..791e9f45c15 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -52,7 +52,7 @@ bool read_PLY(std::istream& is, ColorOutputIterator vc_out, HUVOutputIterator huvs_out, const bool verbose = false, - std::enable_if_t>* = nullptr) + std::enable_if_t::value>* = nullptr) { typedef typename boost::range_value::type Point_3; typedef CGAL::IO::Color Color_rgb; diff --git a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h index 89f4a64c0de..17251cc43a1 100644 --- a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h +++ b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h @@ -704,13 +704,7 @@ bool read_PLY_faces(std::istream& in, PolygonRange& polygons, ColorOutputIterator fc_out, const char* vertex_indices_tag, - std::enable_if_t< -#if defined(MSC_VER_) && (MSC_VER > 1900) - CGAL::is_iterator_v -#else - CGAL::is_iterator::value -#endif - >* = nullptr) + std::enable_if_t::value>* = nullptr) { typedef CGAL::IO::Color Color_rgb; diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index d96c746a548..9d294ac7ec2 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -33,7 +33,7 @@ namespace CGAL { namespace internal{ -template > +template ::value> struct Get_iterator_value_type{ struct type{}; };