Skip to content

Commit

Permalink
Replace some boost with std.
Browse files Browse the repository at this point in the history
It doesn't help much, but we should still stop using those boost
facilities that are now standard.
  • Loading branch information
mglisse committed Feb 8, 2019
1 parent 9fef604 commit 02cfcaf
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions NewKernel_d/include/CGAL/NewKernel_d/Cartesian_LA_functors.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <CGAL/transforming_iterator.h>
#include <CGAL/NewKernel_d/store_kernel.h>
#include <CGAL/Dimension.h>
#include <type_traits>

namespace CGAL {
namespace CartesianDVectorBase {
Expand Down Expand Up @@ -66,64 +67,64 @@ template<class R_,class Zero_> struct Construct_LA_vector
}
template<class...U>
typename std::enable_if<Constructible_from_each<RT,U...>::value &&
boost::is_same<Dimension_tag<sizeof...(U)>, Dimension>::value,
std::is_same<Dimension_tag<sizeof...(U)>, Dimension>::value,
result_type>::type
operator()(U&&...u)const{
return typename Constructor::Values()(std::forward<U>(u)...);
}
//template<class...U,class=typename std::enable_if<Constructible_from_each<RT,U...>::value>::type,class=typename std::enable_if<(sizeof...(U)==static_dim+1)>::type,class=void>
template<class...U>
typename std::enable_if<Constructible_from_each<RT,U...>::value &&
boost::is_same<Dimension_tag<sizeof...(U)-1>, Dimension>::value,
std::is_same<Dimension_tag<sizeof...(U)-1>, Dimension>::value,
result_type>::type
operator()(U&&...u)const{
return Apply_to_last_then_rest()(typename Constructor::Values_divide(),std::forward<U>(u)...);
}
template<class Iter> inline
typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::forward_iterator_tag>::value,result_type> operator()
(Iter f,Iter g,Cartesian_tag t)const
{
return this->operator()((int)std::distance(f,g),f,g,t);
}
template<class Iter> inline
typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::forward_iterator_tag>::value,result_type> operator()
(int d,Iter f,Iter g,Cartesian_tag)const
{
CGAL_assertion(d==std::distance(f,g));
CGAL_assertion(check_dimension_eq(d,this->kernel().dimension()));
return typename Constructor::Iterator()(d,f,g);
}
template<class Iter> inline
typename boost::enable_if<is_iterator_type<Iter,std::bidirectional_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::bidirectional_iterator_tag>::value,result_type> operator()
(Iter f,Iter g,Homogeneous_tag)const
{
--g;
return this->operator()((int)std::distance(f,g),f,g,*g);
}
template<class Iter> inline
typename boost::enable_if<is_iterator_type<Iter,std::bidirectional_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::bidirectional_iterator_tag>::value,result_type> operator()
(int d,Iter f,Iter g,Homogeneous_tag)const
{
--g;
return this->operator()(d,f,g,*g);
}
template<class Iter> inline
typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::forward_iterator_tag>::value,result_type> operator()
(Iter f,Iter g)const
{
// Shouldn't it try comparing dist(f,g) to the dimension if it is known?
return this->operator()(f,g,typename R::Rep_tag());
}
template<class Iter> inline
typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::forward_iterator_tag>::value,result_type> operator()
(int d,Iter f,Iter g)const
{
return this->operator()(d,f,g,typename R::Rep_tag());
}

// Last homogeneous coordinate given separately
template<class Iter,class NT> inline
typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::forward_iterator_tag>::value,result_type> operator()
(int d,Iter f,Iter g,NT const&l)const
{
CGAL_assertion(d==std::distance(f,g));
Expand All @@ -132,7 +133,7 @@ template<class R_,class Zero_> struct Construct_LA_vector
return typename Constructor::Iterator()(d,CGAL::make_transforming_iterator(f,Divide<FT,NT>(l)),CGAL::make_transforming_iterator(g,Divide<FT,NT>(l)));
}
template<class Iter,class NT> inline
typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
typename std::enable_if_t<is_iterator_type<Iter,std::forward_iterator_tag>::value,result_type> operator()
(Iter f,Iter g,NT const&l)const
{
return this->operator()((int)std::distance(f,g),f,g,l);
Expand Down

0 comments on commit 02cfcaf

Please sign in to comment.