Do not use CGAL::iterator_v<> as it is responsible for the ICE of VC2015

This commit is contained in:
Andreas Fabri 2022-06-27 08:58:17 +01:00
parent fe7d09ce90
commit 70a06b4696
14 changed files with 29 additions and 35 deletions

View File

@ -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;

View File

@ -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;
@ -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)
{
@ -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)
{

View File

@ -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);

View File

@ -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.
@ -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);
@ -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(),
@ -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;

View File

@ -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

View File

@ -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;
};
@ -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);
}

View File

@ -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);
}

View File

@ -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
)
{
@ -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
)
{
@ -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);

View File

@ -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
)
{
@ -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
)
{
@ -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);
}

View File

@ -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);
}

View File

@ -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)
{
@ -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)
{
@ -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)
{
@ -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>

View File

@ -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;

View File

@ -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;

View File

@ -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{};
};