diff --git a/Kernel_d/include/CGAL/Kernel_d/Aff_transformationCd.h b/Kernel_d/include/CGAL/Kernel_d/Aff_transformationCd.h index ddd4d5e9b40..2d850be5fdf 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Aff_transformationCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/Aff_transformationCd.h @@ -77,7 +77,7 @@ Aff_transformationCd(const Matrix& M) : Base( Rep(M) ) template Aff_transformationCd(Scaling, Forward_iterator start, Forward_iterator end) : - Base( Rep(std::distance(start,end)-1) ) + Base( Rep(static_cast(std::distance(start,end))-1) ) /*{\Mcreate introduces the transformation of $d$-space specified by a diagonal matrix with entries |set [start,end)| on the diagonal (a scaling of the space). \precond |set [start,end)| is a vector of diff --git a/Kernel_d/include/CGAL/Kernel_d/Aff_transformationHd.h b/Kernel_d/include/CGAL/Kernel_d/Aff_transformationHd.h index 1e828d54828..98e6d5e703e 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Aff_transformationHd.h +++ b/Kernel_d/include/CGAL/Kernel_d/Aff_transformationHd.h @@ -107,7 +107,7 @@ matrix $M$. \precond |M| is a square matrix of dimension $d + 1$. }*/ template Aff_transformationHd(Scaling, Forward_iterator start, Forward_iterator end) : - Base( Rep(std::distance(start,end)-1) ) + Base( Rep(static_cast(std::distance(start,end))-1) ) /*{\Mcreate introduces the transformation of $d$-space specified by a diagonal matrix with entries |set [start,end)| on the diagonal (a scaling of the space). \precond |set [start,end)| is a vector of diff --git a/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h b/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h index ada3930f2d1..7c020c0775f 100644 --- a/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h @@ -73,7 +73,7 @@ construct_from_points(ForwardIterator first, ForwardIterator last, "hyperplane::construction: dimensions disagree."); int d = first->dimension(); // we are in $d$ - dimensional space - int m = std::distance(first,last); // |P| has $m$ points + int m = static_cast(std::distance(first,last)); // |P| has $m$ points typename LA::Matrix A(m,d + 1); for (int i = 0; i < m; i++) { /* define $i$-th equation */ diff --git a/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h b/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h index 12669817846..0d8857c30f1 100644 --- a/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h +++ b/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h @@ -135,7 +135,7 @@ construct_from_points(ForwardIterator first, ForwardIterator last, "hyperplane::construction: dimensions disagree."); int d = first->dimension(); // we are in $d$ - dimensional space - int m = std::distance(first,last); // |P| has $m$ points + int m = static_cast(std::distance(first,last)); // |P| has $m$ points typename LA::Matrix A(m,d + 1); for (int i = 0; i < m; i++) { /* define $i$-th equation */ diff --git a/Kernel_d/include/CGAL/Kernel_d/Matrix__.h b/Kernel_d/include/CGAL/Kernel_d/Matrix__.h index e33fa385285..f0d0561ce48 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Matrix__.h +++ b/Kernel_d/include/CGAL/Kernel_d/Matrix__.h @@ -221,7 +221,7 @@ void range_initialize(RAIterator first, RAIterator last, std::random_access_iterator_tag) { typedef typename std::iterator_traits::value_type value_type; typedef typename value_type::const_iterator const_iterator; - dn_ = last-first; + dn_ = static_cast(last-first); if (dn_ == 0) { dm_=0; v_=0; return; } dm_ = first->dimension(); if (dm_ > 0) { diff --git a/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h b/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h index e0e41cefca0..9d7dbb70d37 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h @@ -135,7 +135,7 @@ Sphere_d(const Self& c) : Base(c) {} int dimension() const /*{\Mop returns the dimension of |\Mvar|.}*/ -{ return ptr()->P.size() - 1; } + { return static_cast(ptr()->P.size()) - 1; } Point_d point(int i) const /*{\Mop returns the $i$-th defining point. \precond $0 \le i \le |dim|$.}*/ @@ -309,7 +309,7 @@ operator>>(std::istream& is, CGAL::Sphere_d& s) if (!(is >> p)) return is; V[d] = p; } - s = Sphere_d(V.size()-1, V.begin(), V.end() ); + s = Sphere_d(static_cast(V.size())-1, V.begin(), V.end() ); return is; } diff --git a/Kernel_d/include/CGAL/Kernel_d/Vector__.h b/Kernel_d/include/CGAL/Kernel_d/Vector__.h index 942dfbbf56d..58176a98b17 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Vector__.h +++ b/Kernel_d/include/CGAL/Kernel_d/Vector__.h @@ -167,7 +167,7 @@ Vector_(Forward_iterator first, Forward_iterator last) Forward_iterator fit = first; while(fit++!=last) d_++; #else - d_ = std::distance(first, last); + d_ = static_cast(std::distance(first, last)); #endif allocate_vec_space(v_,d_); iterator it = begin(); diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h b/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h index 9c5c394a133..3c310c7a713 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h @@ -183,7 +183,7 @@ typedef typename R::LA LA; template Orientation operator()(ForwardIterator first, ForwardIterator last) { TUPLE_DIM_CHECK(first,last,Orientation_d); - int d = std::distance(first,last); + int d = static_cast(std::distance(first,last)); // range contains d points of dimension d-1 CGAL_assertion_msg(first->dimension() == d-1, "Orientation_d: needs first->dimension() + 1 many points."); @@ -210,7 +210,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last, const Point_d& x) { TUPLE_DIM_CHECK(first,last,Side_of_oriented_sphere_d); - int d = std::distance(first,last); // |A| contains |d| points + int d = static_cast(std::distance(first,last)); // |A| contains |d| points CGAL_assertion_msg((d-1 == first->dimension()), "Side_of_oriented_sphere_d: needs first->dimension()+1 many input points."); typename LA::Matrix M(d + 1); @@ -278,7 +278,7 @@ bool operator()(ForwardIterator first, ForwardIterator last, const Point_d& p) { TUPLE_DIM_CHECK(first,last,Contained_in_simplex_d); - int k = std::distance(first,last); // |A| contains |k| points + int k = static_cast(std::distance(first,last)); // |A| contains |k| points int d = first->dimension(); CGAL_assertion_code( typename R::Affinely_independent_d check_independence; ) @@ -319,7 +319,7 @@ bool operator()(ForwardIterator first, ForwardIterator last, const Point_d& p) { TUPLE_DIM_CHECK(first,last,Contained_in_affine_hull_d); - int k = std::distance(first,last); // |A| contains |k| points + int k = static_cast(std::distance(first,last)); // |A| contains |k| points int d = first->dimension(); typename LA::Matrix M(d + 1,k); typename LA::Vector b(d + 1); @@ -346,7 +346,7 @@ template int operator()(ForwardIterator first, ForwardIterator last) { TUPLE_DIM_CHECK(first,last,Affine_rank_d); - int k = std::distance(first,last); // |A| contains |k| points + int k = static_cast(std::distance(first,last)); // |A| contains |k| points if (k == 0) return -1; if (k == 1) return 0; int d = first->dimension(); @@ -369,7 +369,7 @@ typedef typename R::LA LA; template bool operator()(ForwardIterator first, ForwardIterator last) { typename R::Affine_rank_d rank; - int n = std::distance(first,last); + int n = static_cast(std::distance(first,last)); return rank(first,last) == n-1; } }; @@ -393,7 +393,7 @@ template bool operator()( ForwardIterator first, ForwardIterator last, const Vector_d& x) { TUPLE_DIM_CHECK(first,last,Contained_in_linear_hull_d); - int k = std::distance(first,last); // |A| contains |k| vectors + int k = static_cast(std::distance(first,last)); // |A| contains |k| vectors int d = first->dimension(); typename LA::Matrix M(d,k); typename LA::Vector b(d); @@ -412,7 +412,7 @@ typedef typename R::LA LA; template int operator()(ForwardIterator first, ForwardIterator last) { TUPLE_DIM_CHECK(first,last,linear_rank); - int k = std::distance(first,last); // k vectors + int k = static_cast(std::distance(first,last)); // k vectors int d = first->dimension(); typename LA::Matrix M(d,k); for (int i = 0; i < d ; i++) @@ -428,7 +428,7 @@ typedef typename R::LA LA; template bool operator()(ForwardIterator first, ForwardIterator last) { typename R::Linear_rank_d rank; - return rank(first,last) == std::distance(first,last); + return rank(first,last) == static_cast(std::distance(first,last)); } }; @@ -441,7 +441,7 @@ template OutputIterator operator()(ForwardIterator first, ForwardIterator last, OutputIterator result) { TUPLE_DIM_CHECK(first,last,linear_base); - int k = std::distance(first,last); // k vectors + int k = static_cast(std::distance(first,last)); // k vectors int d = first->dimension(); typename LA::Matrix M(d,k); for (int j = 0; j < k; ++first, ++j) diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h b/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h index 05296d55eb4..8cda82031c3 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h @@ -187,7 +187,7 @@ typedef typename R::LA LA; template Orientation operator()(ForwardIterator first, ForwardIterator last) { TUPLE_DIM_CHECK(first,last,Orientation_d); - int d = std::distance(first,last); + int d = static_cast(std::distance(first,last)); // range contains d points of dimension d-1 CGAL_assertion_msg(first->dimension() == d-1, "Orientation_d: needs first->dimension() + 1 many points."); @@ -213,7 +213,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last, const Point_d& x) { TUPLE_DIM_CHECK(first,last,Side_of_oriented_sphere_d); - int d = std::distance(first,last); // |A| contains |d| points + int d = static_cast(std::distance(first,last)); // |A| contains |d| points CGAL_assertion_msg((d-1 == first->dimension()), "Side_of_oriented_sphere_d: needs first->dimension()+1 many input points."); typename LA::Matrix M(d + 1); @@ -287,7 +287,7 @@ bool operator()(ForwardIterator first, ForwardIterator last, const Point_d& p) { TUPLE_DIM_CHECK(first,last,Contained_in_simplex_d); - int k = std::distance(first,last); // |A| contains |k| points + int k = static_cast(std::distance(first,last)); // |A| contains |k| points int d = first->dimension(); CGAL_assertion_code( typename R::Affinely_independent_d check_independence; ) @@ -327,7 +327,7 @@ bool operator()(ForwardIterator first, ForwardIterator last, const Point_d& p) { TUPLE_DIM_CHECK(first,last,Contained_in_affine_hull_d); - int k = std::distance(first,last); // |A| contains |k| points + int k = static_cast(std::distance(first,last)); // |A| contains |k| points int d = first->dimension(); typename LA::Matrix M(d + 1,k); typename LA::Vector b(p.homogeneous_begin(),p.homogeneous_end()); @@ -350,7 +350,7 @@ template int operator()(ForwardIterator first, ForwardIterator last) { TUPLE_DIM_CHECK(first,last,Affine_rank_d); - int k = std::distance(first,last); // |A| contains |k| points + int k = static_cast(std::distance(first,last)); // |A| contains |k| points if (k == 0) return -1; if (k == 1) return 0; int d = first->dimension(); @@ -374,7 +374,7 @@ typedef typename R::RT RT; template bool operator()(ForwardIterator first, ForwardIterator last) { typename R::Affine_rank_d rank; - int n = std::distance(first,last); + int n = static_cast(std::distance(first,last)); return rank(first,last) == n-1; } }; @@ -398,7 +398,7 @@ template bool operator()( ForwardIterator first, ForwardIterator last, const Vector_d& x) { TUPLE_DIM_CHECK(first,last,Contained_in_linear_hull_d); - int k = std::distance(first,last); // |A| contains |k| vectors + int k = static_cast(std::distance(first,last)); // |A| contains |k| vectors int d = first->dimension(); typename LA::Matrix M(d,k); typename LA::Vector b(d); @@ -418,7 +418,7 @@ typedef typename R::RT RT; template int operator()(ForwardIterator first, ForwardIterator last) { TUPLE_DIM_CHECK(first,last,linear_rank); - int k = std::distance(first,last); // k vectors + int k = static_cast(std::distance(first,last)); // k vectors int d = first->dimension(); typename LA::Matrix M(d,k); for (int i = 0; i < d ; i++) @@ -435,7 +435,7 @@ typedef typename R::RT RT; template bool operator()(ForwardIterator first, ForwardIterator last) { typename R::Linear_rank_d rank; - return rank(first,last) == std::distance(first,last); + return rank(first,last) == static_cast(std::distance(first,last)); } }; @@ -449,7 +449,7 @@ template OutputIterator operator()(ForwardIterator first, ForwardIterator last, OutputIterator result) { TUPLE_DIM_CHECK(first,last,linear_base); - int k = std::distance(first,last); // k vectors + int k = static_cast(std::distance(first,last)); // k vectors int d = first->dimension(); typename LA::Matrix M(d,k); for (int j = 0; j < k; j++)