Skip to content

Commit

Permalink
Do not use CGAL::iterator_v<> as it is responsible for the ICE of VC2015
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Jun 27, 2022
1 parent fe7d09c commit 70a06b4
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<CGAL::is_iterator_v<InputIterator>>* = 0,
std::enable_if_t<CGAL::is_iterator<InputIterator>:value>* = 0,
Disable_if_Polygon_2_iterator<InputIterator>* = 0)
{
typename Iterator_to_gps_traits<InputIterator>::Traits traits;
Expand Down
6 changes: 3 additions & 3 deletions Convex_hull_3/include/CGAL/convex_hull_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ template <class InputIterator, class PolygonMesh>
void convex_hull_3(InputIterator first, InputIterator beyond,
PolygonMesh& polyhedron,
// workaround to avoid ambiguity with next overload.
std::enable_if_t<CGAL::is_iterator_v<InputIterator>>* = 0)
std::enable_if_t<CGAL::is_iterator<InputIterator>::value>* = 0)
{
typedef typename std::iterator_traits<InputIterator>::value_type Point_3;
typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3<Point_3, PolygonMesh>::type Traits;
Expand Down Expand Up @@ -1084,7 +1084,7 @@ template <class InputIterator, class PointRange, class TriangleRange>
void convex_hull_3(InputIterator first, InputIterator beyond,
PointRange& vertices,
TriangleRange& faces,
std::enable_if_t<CGAL::is_iterator_v<InputIterator>>* = 0,
std::enable_if_t<CGAL::is_iterator<InputIterator>::value>* = 0,
std::enable_if_t<boost::has_range_iterator<PointRange>::value>* = 0,
std::enable_if_t<boost::has_range_iterator<TriangleRange>::value>* = 0)
{
Expand All @@ -1101,7 +1101,7 @@ void convex_hull_3(InputIterator first, InputIterator beyond,
PointRange& vertices,
TriangleRange& faces,
const Traits& traits,
std::enable_if_t<CGAL::is_iterator_v<InputIterator>>* = 0,
std::enable_if_t<CGAL::is_iterator<InputIterator>::value>* = 0,
std::enable_if_t<boost::has_range_iterator<PointRange>::value>* = 0,
std::enable_if_t<boost::has_range_iterator<TriangleRange>::value>* = 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<OutputFunctor>
!is_iterator<OutputFunctor>::value
>* = 0)
{
CGAL_precondition(dt.dimension() == 2);
Expand Down
8 changes: 4 additions & 4 deletions Interpolation/include/CGAL/regular_neighbor_coordinates_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<OutputIteratorVorVertices>
is_iterator<OutputIteratorVorVertices>::value
>* = 0)
{
// Same as above but without OutputFunctor. Default to extracting the point, for backward compatibility.
Expand All @@ -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<OutputFunctor>
!is_iterator<OutputFunctor>::value
>* = 0)
{
return regular_neighbor_coordinates_2(rt, p, out, fct, Emptyset_iterator(), start);
Expand Down Expand Up @@ -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<OutputFunctor>
!is_iterator<OutputFunctor>::value
>* = 0)
{
return regular_neighbor_coordinates_2(rt, p, out, fct, Emptyset_iterator(),
Expand All @@ -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<OutputIteratorVorVertices>
is_iterator<OutputIteratorVorVertices>::value
>* = 0)
{
typedef typename Rt::Geom_traits::FT FT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace CGAL { namespace Mesh_3 {
/// retrieve the patch_id() of the facet.
template <typename MeshDomain,
typename Primitive,
bool id_is_iterator = CGAL::is_iterator_v<typename Primitive::Id> >
bool id_is_iterator = CGAL::is_iterator<typename Primitive::Id>::value >
struct Facet_patch_id_map;

// Primitive::Id is an iterator type
Expand Down
4 changes: 2 additions & 2 deletions NewKernel_d/include/CGAL/NewKernel_d/KernelD_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ typename typeset_intersection<typename K1::Object_list, typename K2::Object_list
KernelD_converter(K1 const&a,K2 const&b):Store_kernel<K1>(a),Store_kernel2<K2>(b){}

// For the (not anymore used in CGAL) boost result of, used in transforming_iterator
template<class T,int i=is_iterator_v<T>?42:0> struct result:Base::template result<T>{};
template<class T,int i=is_iterator<T>::value?42:0> struct result:Base::template result<T>{};
template<class T> struct result<Final_(T),42> {
typedef transforming_iterator<Final_,T> type;
};
Expand All @@ -160,7 +160,7 @@ typename typeset_intersection<typename K1::Object_list, typename K2::Object_list
{ return o; } // Both kernels should have the same, returning a reference should warn if not.

template<class It>
transforming_iterator<Final_,std::enable_if_t<is_iterator_v<It>,It>>
transforming_iterator<Final_,std::enable_if_t<is_iterator<It>::value,It>>
operator()(It const& it) const {
return make_transforming_iterator(it,*this);
}
Expand Down
2 changes: 1 addition & 1 deletion Point_set_processing_3/include/CGAL/IO/read_las_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ bool read_LAS(std::istream& is,

template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
bool read_LAS(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(),
std::enable_if_t<CGAL::is_iterator_v<OutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<OutputIterator>::value>* = nullptr)
{
return read_LAS<typename value_type_traits<OutputIterator>::type>(is, output, np);
}
Expand Down
8 changes: 4 additions & 4 deletions Point_set_processing_3/include/CGAL/IO/read_off_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<CGAL::is_iterator_v<PointOutputIterator>>* = nullptr
, std::enable_if_t<CGAL::is_iterator<PointOutputIterator>::value>* = nullptr
#endif
)
{
Expand Down Expand Up @@ -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<CGAL::is_iterator_v<PointOutputIterator>>* = nullptr
, std::enable_if_t<CGAL::is_iterator<PointOutputIterator>::value>* = nullptr
#endif
)
{
Expand All @@ -258,14 +258,14 @@ bool read_OFF(const std::string& fname,
template <typename OutputIterator,
typename CGAL_NP_TEMPLATE_PARAMETERS>
bool read_OFF(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(),
std::enable_if_t<CGAL::is_iterator_v<OutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<OutputIterator>::value>* = nullptr)
{
return read_OFF<typename value_type_traits<OutputIterator>::type>(is, output, np);
}

template <typename OutputIterator,typename CGAL_NP_TEMPLATE_PARAMETERS>
bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(),
std::enable_if_t<CGAL::is_iterator_v<OutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<OutputIterator>::value>* = nullptr)
{
std::ifstream is(fname);
return read_OFF<typename value_type_traits<OutputIterator>::type>(is, output, np);
Expand Down
8 changes: 4 additions & 4 deletions Point_set_processing_3/include/CGAL/IO/read_ply_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<CGAL::is_iterator_v<PointOutputIterator>>* = nullptr
, std::enable_if_t<CGAL::is_iterator<PointOutputIterator>::value>* = nullptr
#endif
)
{
Expand Down Expand Up @@ -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<CGAL::is_iterator_v<PointOutputIterator>>* = nullptr
, std::enable_if_t<CGAL::is_iterator<PointOutputIterator>::value>* = nullptr
#endif
)
{
Expand All @@ -350,14 +350,14 @@ bool read_PLY(const std::string& fname,
// variants with default output iterator value type
template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
bool read_PLY(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(),
std::enable_if_t<CGAL::is_iterator_v<OutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<OutputIterator>::value>* = nullptr)
{
return read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, np);
}

template <typename OutputIterator,typename CGAL_NP_TEMPLATE_PARAMETERS>
bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(),
std::enable_if_t<CGAL::is_iterator_v<OutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<OutputIterator>::value>* = nullptr)
{
return read_PLY<typename value_type_traits<OutputIterator>::type>(fname, output, np);
}
Expand Down
2 changes: 1 addition & 1 deletion Point_set_processing_3/include/CGAL/IO/read_xyz_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ bool read_XYZ(const std::string& fname,
// variants with default output iterator value type
template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
bool read_XYZ(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values(),
std::enable_if_t<CGAL::is_iterator_v<OutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<OutputIterator>::value>* = nullptr)
{
return read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output, np);
}
Expand Down
8 changes: 4 additions & 4 deletions Principal_component_analysis_LGPL/include/CGAL/centroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ struct Dispatch_centroid_3

template < typename InputIterator, typename K>
typename internal::Dispatch_centroid_3<
std::enable_if_t<is_iterator_v<InputIterator>,InputIterator>,
std::enable_if_t<is_iterator<InputIterator>::value,InputIterator>,
K,Dynamic_dimension_tag>::result_type
centroid(InputIterator begin, InputIterator end, const K& k, Dynamic_dimension_tag tag)
{
Expand All @@ -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<is_iterator_v<InputIterator>,InputIterator>,
std::enable_if_t<is_iterator<InputIterator>::value,InputIterator>,
K,Dimension_tag<d> >::result_type
centroid(InputIterator begin, InputIterator end, const K& k, Dimension_tag<d> tag)
{
Expand Down Expand Up @@ -897,7 +897,7 @@ struct Dispatch_centroid <InputIterator, Dynamic_dimension_tag>
template < typename InputIterator, typename Kernel_or_dim >
inline
typename internal::Dispatch_centroid<
std::enable_if_t<is_iterator_v<InputIterator>,InputIterator>,
std::enable_if_t<is_iterator<InputIterator>::value,InputIterator>,
Kernel_or_dim>::result_type
centroid(InputIterator begin, InputIterator end, const Kernel_or_dim& k_or_d)
{
Expand All @@ -906,7 +906,7 @@ centroid(InputIterator begin, InputIterator end, const Kernel_or_dim& k_or_d)
}

namespace internal {
template<class It,bool=is_iterator_v<It>>
template<class It,bool=is_iterator<It>::value>
class Centroid_2args_return_type_helper{};

template<class It>
Expand Down
2 changes: 1 addition & 1 deletion Stream_support/include/CGAL/IO/PLY.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bool read_PLY(std::istream& is,
ColorOutputIterator vc_out,
HUVOutputIterator huvs_out,
const bool verbose = false,
std::enable_if_t<CGAL::is_iterator_v<ColorOutputIterator>>* = nullptr)
std::enable_if_t<CGAL::is_iterator<ColorOutputIterator>::value>* = nullptr)
{
typedef typename boost::range_value<PointRange>::type Point_3;
typedef CGAL::IO::Color Color_rgb;
Expand Down
8 changes: 1 addition & 7 deletions Stream_support/include/CGAL/IO/PLY/PLY_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ColorOutputIterator>
#else
CGAL::is_iterator<ColorOutputIterator>::value
#endif
>* = nullptr)
std::enable_if_t<CGAL::is_iterator<ColorOutputIterator>::value>* = nullptr)
{
typedef CGAL::IO::Color Color_rgb;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace CGAL {

namespace internal{

template <class T,bool has_info=is_iterator_v<T>>
template <class T,bool has_info=is_iterator<T>::value>
struct Get_iterator_value_type{
struct type{};
};
Expand Down

0 comments on commit 70a06b4

Please sign in to comment.