diff --git a/Circular_kernel_2/include/CGAL/Circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_arc_2.h index 067a6058e4f..996f4cf890c 100644 --- a/Circular_kernel_2/include/CGAL/Circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_arc_2.h @@ -110,25 +110,25 @@ public: {} - typename boost::result_of::type + typename cpp11::result_of::type source() const { return typename R::Construct_circular_source_vertex_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type target() const { return typename R::Construct_circular_target_vertex_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type left() const { return typename R::Construct_circular_min_vertex_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type right() const { return typename R::Construct_circular_max_vertex_2()(*this); @@ -144,19 +144,19 @@ public: return typename R::Is_y_monotone_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type supporting_circle() const { return typename R::Construct_circle_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type center() const { return typename R::Construct_center_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type squared_radius() const { return typename R::Compute_squared_radius_2()(*this); diff --git a/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h b/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h index d1274215545..e9be14a69e3 100644 --- a/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h @@ -74,14 +74,14 @@ public: {} typename - boost::result_of::type + cpp11::result_of::type x() const { return typename R::Compute_circular_x_2()(*this); } typename - boost::result_of::type + cpp11::result_of::type y() const { return typename R::Compute_circular_y_2()(*this); diff --git a/Circular_kernel_2/include/CGAL/Line_arc_2.h b/Circular_kernel_2/include/CGAL/Line_arc_2.h index 071c4aeb4b9..c19b95afc32 100644 --- a/Circular_kernel_2/include/CGAL/Line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Line_arc_2.h @@ -93,25 +93,25 @@ public: : RLine_arc_2(a) {} - typename boost::result_of< typename R::Construct_circular_source_vertex_2(Line_arc_2)>::type + typename cpp11::result_of< typename R::Construct_circular_source_vertex_2(Line_arc_2)>::type source() const { return typename R::Construct_circular_source_vertex_2()(*this); } - typename boost::result_of< typename R::Construct_circular_target_vertex_2(Line_arc_2)>::type + typename cpp11::result_of< typename R::Construct_circular_target_vertex_2(Line_arc_2)>::type target() const { return typename R::Construct_circular_target_vertex_2()(*this); } - typename boost::result_of< typename R::Construct_circular_min_vertex_2(Line_arc_2)>::type + typename cpp11::result_of< typename R::Construct_circular_min_vertex_2(Line_arc_2)>::type left() const { return typename R::Construct_circular_min_vertex_2()(*this); } - typename boost::result_of< typename R::Construct_circular_max_vertex_2(Line_arc_2)>::type + typename cpp11::result_of< typename R::Construct_circular_max_vertex_2(Line_arc_2)>::type right() const { return typename R::Construct_circular_max_vertex_2()(*this); diff --git a/Circular_kernel_3/include/CGAL/Circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_arc_3.h index 97b4631c342..ae5ffdaf2e3 100644 --- a/Circular_kernel_3/include/CGAL/Circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_arc_3.h @@ -120,19 +120,19 @@ namespace CGAL { : RCircular_arc_3(a) {} - typename boost::result_of::type + typename cpp11::result_of::type source() const { return typename R::Construct_circular_source_vertex_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type target() const { return typename R::Construct_circular_target_vertex_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type supporting_circle() const { return typename R::Construct_circle_3()(*this); diff --git a/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h b/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h index 9fb9bd6dd37..43641b2d335 100644 --- a/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h @@ -197,15 +197,15 @@ public: - typename boost::result_of::type + typename cpp11::result_of::type x() const { return typename R::Compute_circular_x_3()(*this);} - typename boost::result_of::type + typename cpp11::result_of::type y() const { return typename R::Compute_circular_y_3()(*this);} - typename boost::result_of::type + typename cpp11::result_of::type z() const { return typename R::Compute_circular_z_3()(*this);} diff --git a/Circular_kernel_3/include/CGAL/Line_arc_3.h b/Circular_kernel_3/include/CGAL/Line_arc_3.h index 70cd6ebfe17..43325a4ff06 100644 --- a/Circular_kernel_3/include/CGAL/Line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Line_arc_3.h @@ -123,31 +123,31 @@ namespace CGAL { : RLine_arc_3(a) {} - typename boost::result_of::type + typename cpp11::result_of::type source() const { return typename R::Construct_circular_source_vertex_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type target() const { return typename R::Construct_circular_target_vertex_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type lower_xyz_extremity() const { return typename R::Construct_circular_min_vertex_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type higher_xyz_extremity() const { return typename R::Construct_circular_max_vertex_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type supporting_line() const { return typename R::Construct_line_3()(*this); diff --git a/Documentation/doc/Preliminaries.txt b/Documentation/doc/Preliminaries.txt index a04f87aed92..7267ca46b4b 100644 --- a/Documentation/doc/Preliminaries.txt +++ b/Documentation/doc/Preliminaries.txt @@ -160,7 +160,7 @@ protocol. If a functor `F` has the same return type across all overloads of `operator()`, the nested type `F::result_type` is defined to be that type. Otherwise the return type of calling the functor with an argument of type -`Arg` can be accessed through `boost::%result_of::%type`. +`Arg` can be accessed through \link CGAL::cpp11::result_of::type `CGAL::cpp11::result_of::type` \endlink. \section preliminaries_secchecks Checks diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 46c6fbda58f..928b742340f 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -809,21 +809,21 @@ struct Lazy_construction_nt { BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, T) \ typedef Lazy_exact_nt< \ typename boost::remove_cv< typename boost::remove_reference < \ - typename boost::result_of::type >::type >::type > type; \ + typename cpp11::result_of::type >::type >::type > type; \ }; BOOST_PP_REPEAT_FROM_TO(1, 6, CGAL_RESULT_NT, _) #define CGAL_NT_OPERATOR(z, n, d) \ template \ - typename boost::result_of::type \ + typename cpp11::result_of::type \ operator()( BOOST_PP_ENUM(n, CGAL_LARGS, _) ) const { \ BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, L) \ BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, L) \ typedef typename boost::remove_cv< typename boost::remove_reference < \ - typename boost::result_of< EC(BOOST_PP_ENUM_PARAMS(n, E)) >::type >::type >::type ET; \ + typename cpp11::result_of< EC(BOOST_PP_ENUM_PARAMS(n, E)) >::type >::type >::type ET; \ typedef typename boost::remove_cv< typename boost::remove_reference < \ - typename boost::result_of< AC(BOOST_PP_ENUM_PARAMS(n, A)) >::type >::type >::type AT; \ + typename cpp11::result_of< AC(BOOST_PP_ENUM_PARAMS(n, A)) >::type >::type >::type AT; \ CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \ Protect_FPU_rounding P; \ try { \ @@ -1424,23 +1424,23 @@ struct Lazy_construction template< typename F, BOOST_PP_ENUM_PARAMS(n, class T) > \ struct result { \ BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, T) \ - typedef typename Type_mapper< typename boost::result_of::type, AK, LK>::type type; \ + typedef typename Type_mapper< typename cpp11::result_of::type, AK, LK>::type type; \ }; BOOST_PP_REPEAT_FROM_TO(1, 9, CGAL_RESULT, _) #define CGAL_CONSTRUCTION_OPERATOR(z, n, d) \ template \ - typename boost::result_of::type \ + typename cpp11::result_of::type \ operator()( BOOST_PP_ENUM(n, CGAL_LARGS, _) ) { \ BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, L) \ BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, L) \ typedef typename boost::remove_cv< typename boost::remove_reference < \ - typename boost::result_of< EC(BOOST_PP_ENUM_PARAMS(n, E)) >::type >::type >::type ET; \ + typename cpp11::result_of< EC(BOOST_PP_ENUM_PARAMS(n, E)) >::type >::type >::type ET; \ typedef typename boost::remove_cv< typename boost::remove_reference < \ - typename boost::result_of< AC(BOOST_PP_ENUM_PARAMS(n, A)) >::type >::type >::type AT; \ + typename cpp11::result_of< AC(BOOST_PP_ENUM_PARAMS(n, A)) >::type >::type >::type AT; \ typedef Lazy< AT, ET, EFT, E2A> Handle; \ - typedef typename boost::result_of::type result_type; \ + typedef typename cpp11::result_of::type result_type; \ CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \ Protect_FPU_rounding P; \ try { \ @@ -1456,13 +1456,13 @@ struct result { \ BOOST_PP_REPEAT_FROM_TO(1, 9, CGAL_CONSTRUCTION_OPERATOR, _) // nullary - typename Type_mapper< typename boost::result_of::type ,AK, LK>::type + typename Type_mapper< typename cpp11::result_of::type ,AK, LK>::type operator()() const { - typedef typename boost::result_of::type AT; - typedef typename boost::result_of::type ET; + typedef typename cpp11::result_of::type AT; + typedef typename cpp11::result_of::type ET; typedef Lazy Handle; - typedef typename Type_mapper< typename boost::result_of::type ,AK, LK>::type result_type; + typedef typename Type_mapper< typename cpp11::result_of::type ,AK, LK>::type result_type; return result_type( Handle(new Lazy_rep_0()) ); } diff --git a/Installation/changes.html b/Installation/changes.html index bca43af2797..8e4ecc704e0 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -147,6 +147,13 @@ David A. Wheeler's 'SLOCCount', restricted to the include/CGAL/
  • Addition of the Combination_enumerator +

    STL Extensions

    +
      +
    • Introduction of CGAL::cpp11::result_of as an alias to the tr1 implementation from boost of the result_of mechanism. +When all compilers supported by CGAL will have a Standard compliant implemention of the C++11 decltype feature, it will become an alias to +std::result_of. +
    • +

    Surface Reconstruction from Point Sets

      diff --git a/Kernel_23/include/CGAL/Circle_2.h b/Kernel_23/include/CGAL/Circle_2.h index 4dcadc88c1d..70d27c066fa 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -95,13 +95,13 @@ public: Circle_2(const Point_2 & center) : RCircle_2(typename R::Construct_circle_2()(Return_base_tag(), center, FT(0), COUNTERCLOCKWISE)) {} - typename boost::result_of::type + typename cpp11::result_of::type center() const { return R().construct_center_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type squared_radius() const { return R().compute_squared_radius_2_object()(*this); diff --git a/Kernel_23/include/CGAL/Circle_3.h b/Kernel_23/include/CGAL/Circle_3.h index 74588fd33b1..a1f9c181f6e 100644 --- a/Kernel_23/include/CGAL/Circle_3.h +++ b/Kernel_23/include/CGAL/Circle_3.h @@ -101,7 +101,7 @@ public: Circle_3(const Rep& r) : Rep(r) {} - typename boost::result_of + typename cpp11::result_of ::type diametral_sphere() const { @@ -118,7 +118,7 @@ public: return typename R::Construct_sphere_3()(*this).squared_radius(); } - typename boost::result_of + typename cpp11::result_of ::type supporting_plane() const { diff --git a/Kernel_23/include/CGAL/Direction_2.h b/Kernel_23/include/CGAL/Direction_2.h index 093faf2a9f8..265ff825ff4 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -98,19 +98,19 @@ public: return R().construct_perpendicular_direction_2_object()(*this,o); } - typename boost::result_of::type + typename cpp11::result_of::type dx() const { return R().compute_dx_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type dy() const { return R().compute_dy_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type delta(int i) const { CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) ); diff --git a/Kernel_23/include/CGAL/Direction_3.h b/Kernel_23/include/CGAL/Direction_3.h index 155f0f69fcb..91afea14091 100644 --- a/Kernel_23/include/CGAL/Direction_3.h +++ b/Kernel_23/include/CGAL/Direction_3.h @@ -104,25 +104,25 @@ public: Vector_3 vector() const { return to_vector(); } - typename boost::result_of::type + typename cpp11::result_of::type dx() const { return R().compute_dx_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type dy() const { return R().compute_dy_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type dz() const { return R().compute_dz_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type delta(int i) const { CGAL_kernel_precondition( i >= 0 && i <= 2 ); diff --git a/Kernel_23/include/CGAL/Iso_cuboid_3.h b/Kernel_23/include/CGAL/Iso_cuboid_3.h index 276f3199178..eb10420ed25 100644 --- a/Kernel_23/include/CGAL/Iso_cuboid_3.h +++ b/Kernel_23/include/CGAL/Iso_cuboid_3.h @@ -90,67 +90,67 @@ public: : Rep(typename R::Construct_iso_cuboid_3()(Return_base_tag(), min_hx, min_hy, min_hz, max_hx, max_hy, max_hz)) {} - typename boost::result_of::type + typename cpp11::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_min_vertex_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_max_vertex_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const { return R().construct_vertex_3_object()(*this,i); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return R().construct_vertex_3_object()(*this,i); } - typename boost::result_of::type + typename cpp11::result_of::type xmin() const { return R().compute_xmin_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type xmax() const { return R().compute_xmax_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type ymin() const { return R().compute_ymin_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type ymax() const { return R().compute_ymax_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type zmin() const { return R().compute_zmin_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type zmax() const { return R().compute_zmax_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type min_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 || i == 2 ); @@ -162,7 +162,7 @@ public: return zmin(); } - typename boost::result_of::type + typename cpp11::result_of::type max_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 || i == 2 ); @@ -210,7 +210,7 @@ public: return R().is_degenerate_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type volume() const { return R().compute_volume_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Iso_rectangle_2.h b/Kernel_23/include/CGAL/Iso_rectangle_2.h index b5777b2a2f1..fb61d6b2373 100644 --- a/Kernel_23/include/CGAL/Iso_rectangle_2.h +++ b/Kernel_23/include/CGAL/Iso_rectangle_2.h @@ -87,13 +87,13 @@ public: : Rep(typename R::Construct_iso_rectangle_2()(Return_base_tag(), min_hx, min_hy, max_hx, max_hy, hw)) {} - typename boost::result_of::type + typename cpp11::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_min_vertex_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_max_vertex_2_object()(*this); @@ -112,43 +112,43 @@ public: } - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const { return R().construct_vertex_2_object()(*this,i); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return R().construct_vertex_2_object()(*this,i); } - typename boost::result_of::type + typename cpp11::result_of::type xmin() const { return R().compute_xmin_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type xmax() const { return R().compute_xmax_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type ymin() const { return R().compute_ymin_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type ymax() const { return R().compute_ymax_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type min_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 ); @@ -158,7 +158,7 @@ public: return ymin(); } - typename boost::result_of::type + typename cpp11::result_of::type max_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 ); diff --git a/Kernel_23/include/CGAL/Plane_3.h b/Kernel_23/include/CGAL/Plane_3.h index a168a82b0d9..9414daa74eb 100644 --- a/Kernel_23/include/CGAL/Plane_3.h +++ b/Kernel_23/include/CGAL/Plane_3.h @@ -113,25 +113,25 @@ public: return Direction_3(a(), b(), c()); } - typename boost::result_of::type + typename cpp11::result_of::type a() const { return R().compute_a_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type b() const { return R().compute_b_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type c() const { return R().compute_c_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type d() const { return R().compute_d_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Point_2.h b/Kernel_23/include/CGAL/Point_2.h index b63f0ef772f..1d15459eff3 100644 --- a/Kernel_23/include/CGAL/Point_2.h +++ b/Kernel_23/include/CGAL/Point_2.h @@ -85,26 +85,26 @@ public: : RPoint_2(typename R::Construct_point_2()(Return_base_tag(), hx, hy, hw)) {} - typename boost::result_of::type + typename cpp11::result_of::type x() const { return typename R::Compute_x_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type y() const { return typename R::Compute_y_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) ); return (i==0) ? x() : y(); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return cartesian(i); @@ -122,19 +122,19 @@ public: - typename boost::result_of::type + typename cpp11::result_of::type hx() const { return typename R::Compute_hx_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hy() const { return typename R::Compute_hy_2()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hw() const { return typename R::Compute_hw_2()(*this); @@ -145,7 +145,7 @@ public: return 2; } - typename boost::result_of::type + typename cpp11::result_of::type homogeneous(int i) const { CGAL_kernel_precondition( (i >= 0) || (i <= 2) ); diff --git a/Kernel_23/include/CGAL/Point_3.h b/Kernel_23/include/CGAL/Point_3.h index c811c405299..c595cd9765e 100644 --- a/Kernel_23/include/CGAL/Point_3.h +++ b/Kernel_23/include/CGAL/Point_3.h @@ -84,49 +84,49 @@ public: : Rep(typename R::Construct_point_3()(Return_base_tag(), hx, hy, hz, hw)) {} - typename boost::result_of::type + typename cpp11::result_of::type x() const { return typename R::Compute_x_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type y() const { return typename R::Compute_y_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type z() const { return typename R::Compute_z_3()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hx() const { return R().compute_hx_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hy() const { return R().compute_hy_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hz() const { return R().compute_hz_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hw() const { return R().compute_hw_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) ); @@ -145,7 +145,7 @@ public: return hw(); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return cartesian(i); diff --git a/Kernel_23/include/CGAL/Ray_2.h b/Kernel_23/include/CGAL/Ray_2.h index a5cd969e9c1..f01f6feb4d6 100644 --- a/Kernel_23/include/CGAL/Ray_2.h +++ b/Kernel_23/include/CGAL/Ray_2.h @@ -86,13 +86,13 @@ public: : RRay_2(typename R::Construct_ray_2()(Return_base_tag(), sp, l)) {} - typename boost::result_of::type + typename cpp11::result_of::type source() const { return R().construct_source_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type second_point() const { return R().construct_second_point_2_object()(*this); @@ -116,7 +116,7 @@ public: } - typename boost::result_of::type + typename cpp11::result_of::type start() const { return source(); diff --git a/Kernel_23/include/CGAL/Ray_3.h b/Kernel_23/include/CGAL/Ray_3.h index a27f8b3be85..1d004ec2063 100644 --- a/Kernel_23/include/CGAL/Ray_3.h +++ b/Kernel_23/include/CGAL/Ray_3.h @@ -105,25 +105,25 @@ public: bool collinear_has_on(const Point_3 &p) const; */ - typename boost::result_of::type + typename cpp11::result_of::type point(int i) const // TODO : use Qrt { return R().construct_point_on_3_object()(*this, i); } - typename boost::result_of::type + typename cpp11::result_of::type source() const { return R().construct_source_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type second_point() const { return R().construct_second_point_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type start() const { return source(); diff --git a/Kernel_23/include/CGAL/Segment_2.h b/Kernel_23/include/CGAL/Segment_2.h index 7e3ef317e73..2aa7307554a 100644 --- a/Kernel_23/include/CGAL/Segment_2.h +++ b/Kernel_23/include/CGAL/Segment_2.h @@ -76,44 +76,44 @@ public: Segment_2(const Point_2 &sp, const Point_2 &ep) : RSegment_2(typename R::Construct_segment_2()(Return_base_tag(), sp,ep)) {} - typename boost::result_of::type + typename cpp11::result_of::type source() const { return R_().construct_source_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type target() const { return R_().construct_target_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type start() const { return source(); } - typename boost::result_of::type + typename cpp11::result_of::type end() const { return target(); } - typename boost::result_of::type + typename cpp11::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const; - typename boost::result_of::type + typename cpp11::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const; - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const; - typename boost::result_of::type + typename cpp11::result_of::type point(int i) const; - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const; bool is_horizontal() const; @@ -178,7 +178,7 @@ public: template < class R_ > CGAL_KERNEL_INLINE -typename boost::result_of )>::type +typename cpp11::result_of )>::type Segment_2::min BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xy_2 less_xy; @@ -187,7 +187,7 @@ Segment_2::min BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -typename boost::result_of )>::type +typename cpp11::result_of )>::type Segment_2::max BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xy_2 less_xy; @@ -196,7 +196,7 @@ Segment_2::max BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -typename boost::result_of, int )>::type +typename cpp11::result_of, int )>::type Segment_2::vertex(int i) const { return (i%2 == 0) ? source() : target(); @@ -204,7 +204,7 @@ Segment_2::vertex(int i) const template < class R_ > inline -typename boost::result_of, int )>::type +typename cpp11::result_of, int )>::type Segment_2::point(int i) const { return vertex(i); @@ -212,7 +212,7 @@ Segment_2::point(int i) const template < class R_ > inline -typename boost::result_of, int )>::type +typename cpp11::result_of, int )>::type Segment_2::operator[](int i) const { return vertex(i); diff --git a/Kernel_23/include/CGAL/Segment_3.h b/Kernel_23/include/CGAL/Segment_3.h index 71239ca618c..a811035c094 100644 --- a/Kernel_23/include/CGAL/Segment_3.h +++ b/Kernel_23/include/CGAL/Segment_3.h @@ -74,44 +74,44 @@ public: Segment_3(const Point_3& sp, const Point_3& ep) : Rep(typename R::Construct_segment_3()(Return_base_tag(), sp, ep)) {} - typename boost::result_of::type + typename cpp11::result_of::type source() const { return R_().construct_source_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type target() const { return R_().construct_target_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type start() const { return source(); } - typename boost::result_of::type + typename cpp11::result_of::type end() const { return target(); } - typename boost::result_of::type + typename cpp11::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const; - typename boost::result_of::type + typename cpp11::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const; - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const; - typename boost::result_of::type + typename cpp11::result_of::type point(int i) const { return vertex(i); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return vertex(i); } @@ -169,7 +169,7 @@ public: template < class R_ > CGAL_KERNEL_INLINE -typename boost::result_of ) >::type +typename cpp11::result_of ) >::type Segment_3::min BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xyz_3 less_xyz; @@ -178,7 +178,7 @@ Segment_3::min BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -typename boost::result_of ) >::type +typename cpp11::result_of ) >::type Segment_3::max BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xyz_3 less_xyz; @@ -187,7 +187,7 @@ Segment_3::max BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -typename boost::result_of, int ) >::type +typename cpp11::result_of, int ) >::type Segment_3::vertex(int i) const { return (i%2 == 0) ? source() : target(); diff --git a/Kernel_23/include/CGAL/Sphere_3.h b/Kernel_23/include/CGAL/Sphere_3.h index 013670f6f17..436d580ffc1 100644 --- a/Kernel_23/include/CGAL/Sphere_3.h +++ b/Kernel_23/include/CGAL/Sphere_3.h @@ -94,7 +94,7 @@ public: Sphere_3 orthogonal_transform(const Aff_transformation_3 &t) const; - typename boost::result_of::type + typename cpp11::result_of::type center() const { return R().construct_center_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Tetrahedron_3.h b/Kernel_23/include/CGAL/Tetrahedron_3.h index 1a1da7f94f8..625421b28c6 100644 --- a/Kernel_23/include/CGAL/Tetrahedron_3.h +++ b/Kernel_23/include/CGAL/Tetrahedron_3.h @@ -78,13 +78,13 @@ public: t.transform(this->vertex(3))); } - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const { return R().construct_vertex_3_object()(*this,i); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return vertex(i); @@ -136,7 +136,7 @@ public: return R().has_on_unbounded_side_3_object()(*this, p); } - typename boost::result_of::type + typename cpp11::result_of::type volume() const { return R().compute_volume_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Triangle_2.h b/Kernel_23/include/CGAL/Triangle_2.h index 720c75ed863..f89aa93fd85 100644 --- a/Kernel_23/include/CGAL/Triangle_2.h +++ b/Kernel_23/include/CGAL/Triangle_2.h @@ -107,13 +107,13 @@ public: return !(*this == t); } - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const { return R().construct_vertex_2_object()(*this,i); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return vertex(i); diff --git a/Kernel_23/include/CGAL/Triangle_3.h b/Kernel_23/include/CGAL/Triangle_3.h index dc8f99802a7..b1d04a16c1d 100644 --- a/Kernel_23/include/CGAL/Triangle_3.h +++ b/Kernel_23/include/CGAL/Triangle_3.h @@ -90,13 +90,13 @@ public: } - typename boost::result_of::type + typename cpp11::result_of::type vertex(int i) const { return R().construct_vertex_3_object()(*this, i); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return vertex(i); diff --git a/Kernel_23/include/CGAL/Vector_2.h b/Kernel_23/include/CGAL/Vector_2.h index c34c00d0815..b0418063344 100644 --- a/Kernel_23/include/CGAL/Vector_2.h +++ b/Kernel_23/include/CGAL/Vector_2.h @@ -99,26 +99,26 @@ public: : RVector_2(typename R::Construct_vector_2()(Return_base_tag(), x,y,w)) {} - typename boost::result_of::type + typename cpp11::result_of::type x() const { return R().compute_x_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type y() const { return R().compute_y_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) ); return (i==0) ? x() : y(); } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return cartesian(i); @@ -134,26 +134,26 @@ public: return typename R::Construct_cartesian_const_iterator_2()(*this,2); } - typename boost::result_of::type + typename cpp11::result_of::type hx() const { return R().compute_hx_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hy() const { return R().compute_hy_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hw() const { return R().compute_hw_2_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type homogeneous(int i) const { CGAL_kernel_precondition( (i >= 0) || (i <= 2) ); diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index 6c25b16a46e..bb5cd39c114 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -133,49 +133,49 @@ public: return R().construct_divided_vector_3_object()(*this,c); } - typename boost::result_of::type + typename cpp11::result_of::type x() const { return R().compute_x_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type y() const { return R().compute_y_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type z() const { return R().compute_z_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hx() const { return R().compute_hx_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hy() const { return R().compute_hy_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hz() const { return R().compute_hz_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type hw() const { return R().compute_hw_3_object()(*this); } - typename boost::result_of::type + typename cpp11::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) ); @@ -184,7 +184,7 @@ public: return z(); } - typename boost::result_of::type + typename cpp11::result_of::type homogeneous(int i) const { CGAL_kernel_precondition( (i >= 0) || (i <= 3) ); @@ -199,7 +199,7 @@ public: return 3; } - typename boost::result_of::type + typename cpp11::result_of::type operator[](int i) const { return cartesian(i); @@ -215,7 +215,7 @@ public: return typename R::Construct_cartesian_const_iterator_3()(*this,3); } - typename boost::result_of::type + typename cpp11::result_of::type squared_length() const { return R().compute_squared_length_3_object()(*this); diff --git a/Kernel_23/include/CGAL/basic.h b/Kernel_23/include/CGAL/basic.h index e05c6e3b28a..7b813f2b2ec 100644 --- a/Kernel_23/include/CGAL/basic.h +++ b/Kernel_23/include/CGAL/basic.h @@ -37,7 +37,7 @@ // #if !defined(CGAL_CFG_NO_CPP0X_DECLTYPE) // #define BOOST_RESULT_OF_USE_DECLTYPE // #endif -#include +#include #include #include diff --git a/Manual/doc_tex/Preliminaries/main.tex b/Manual/doc_tex/Preliminaries/main.tex index b614edd5a2d..7a82e41ec00 100644 --- a/Manual/doc_tex/Preliminaries/main.tex +++ b/Manual/doc_tex/Preliminaries/main.tex @@ -121,7 +121,7 @@ overloads of \ccStyle{operator()}, the nested type \ccStyle{F::result_type} is defined to be that type. Otherwise the return type of calling the functor with an argument of type \ccStyle{Arg} can be accessed through -\ccStyle{boost::result_of::type}. +\ccStyle{CGAL::cpp11::result_of::type}. \input{Preliminaries/checks} % extra chapter diff --git a/STL_Extension/doc/STL_Extension/CGAL/result_of.h b/STL_Extension/doc/STL_Extension/CGAL/result_of.h new file mode 100644 index 00000000000..0dcaf5334f2 --- /dev/null +++ b/STL_Extension/doc/STL_Extension/CGAL/result_of.h @@ -0,0 +1,17 @@ +namespace CGAL { +namespace cpp11 { + + /*! + \ingroup PkgStlExtension + Alias to the tr1 implementation from boost of the `result_of` mechanism. + When all compilers supported by %CGAL will have a Standard compliant implemention of the + the \cpp11 `decltype` feature, it will become an alias to std::result_of. + */ + template + struct result_of{ + /// starting from boost version 1.44, it is `boost::tr1_result_of::%type`, and + /// `boost::result_of::%type` otherwise. + typedef Hidden_type type; + }; + +} } //end of namespace CGAL::cpp11 diff --git a/STL_Extension/include/CGAL/result_of.h b/STL_Extension/include/CGAL/result_of.h new file mode 100644 index 00000000000..928ed285fd1 --- /dev/null +++ b/STL_Extension/include/CGAL/result_of.h @@ -0,0 +1,54 @@ +// Copyright (c) 2013 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// +// Author(s) : Sebastien Loriot + + +#ifndef CGAL_RESULT_OF_H +#define CGAL_RESULT_OF_H + +#include +#include + +namespace CGAL{ + +// Even if for now we use the tr1 result_of implementation, we use the cpp11 +// namespace since in the future, that's the decltype version that will be used +namespace cpp11{ + +template +struct result_of +{ + // from boost 1.44 release note http://www.boost.org/users/history/version_1_44_0.html : + // New template boost::tr1_result_of that implements the TR1 ResultOf protocol even if boost::result_of uses the C++0x decltype-based implementation. + #if BOOST_VERSION < 104400 + typedef typename cpp11::result_of::type type; + #else + typedef typename boost::tr1_result_of::type type; + #endif +}; + +} + +} + +#endif //CGAL_RESULT_OF_H