From 17e00293d11be2bc496992d9938cd5d6200025e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20M=C3=B6ller?= Date: Wed, 2 May 2012 10:08:28 +0000 Subject: [PATCH] Fixed Kernel_d doc to compile again and to use result_of for intersections. --- .../doc_tex/Kernel_d/predicates_constructions_d.tex | 2 +- Kernel_d/doc_tex/Kernel_d_ref/Kernel_Intersect_d.tex | 5 +---- Kernel_d/doc_tex/Kernel_d_ref/intersection.tex | 12 +++++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Kernel_d/doc_tex/Kernel_d/predicates_constructions_d.tex b/Kernel_d/doc_tex/Kernel_d/predicates_constructions_d.tex index 9020f1cfa5e..17963b6f876 100644 --- a/Kernel_d/doc_tex/Kernel_d/predicates_constructions_d.tex +++ b/Kernel_d/doc_tex/Kernel_d/predicates_constructions_d.tex @@ -83,7 +83,7 @@ for more information about this mechanism. Segment s1, s2; std::cin >> s1 >> s2; - boost::result_of::type + boost::result_of::type v = intersection(s1, s2); if(v) { /* not empty */ diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Intersect_d.tex b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Intersect_d.tex index fb9414f3a7c..d7f2199bce3 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Intersect_d.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Intersect_d.tex @@ -3,10 +3,7 @@ A model for this must provide: \ccCreationVariable{fo} -\ccMemberFunction{ - typename - boost::result_of, Type2)>::type - operator()(const Type1& p, const Type2& q);} +\ccMemberFunction{boost::result_of, Type2)>::type operator()(const Type1& p, const Type2& q);} {returns the result of the intersection of $p$ and $q$ in form of a polymorphic object. \ccc{Kernel_object} may be any of \ccc{Kernel::Segment_d}, \ccc{Kernel::Ray_d}, \ccc{Kernel::Line_d}, diff --git a/Kernel_d/doc_tex/Kernel_d_ref/intersection.tex b/Kernel_d/doc_tex/Kernel_d_ref/intersection.tex index c8e6cb50d4f..34352648e10 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/intersection.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/intersection.tex @@ -1,7 +1,7 @@ \begin{ccRefFunction}{intersection} \ccInclude{CGAL/intersections_d.h} -\ccFunction{Kernel::Intersect_d::Result, Type2 >::Type +\ccFunction{result_of, Type2) >::type intersection(Type1 f1, Type2 f2);} { returns the intersection result of $f1$ and $f2$. \ccPrecond The objects are of the same dimension.} @@ -162,8 +162,13 @@ struct Intersection_visitor { template void foo(Segment_d seg, Line_d lin) { - R::Intersect_d::template Result< Segment_d, Line_d > - result = intersection(seg, lin); + // with C++11 support + auto result = intersection(seg, lin); + + // without C++11 support + // typename boost::result_of, Line_d)>::type + // result = intersection(seg, lin); + if(result) { boost::apply_visitor(Intersection_visitor(), *result); } else { /* no intersection */ } } @@ -176,6 +181,7 @@ void foo(Segment_d seg, Line_d lin) \ccc{Kernel::Do_intersect_d}, \\ \ccAnchor{http://www.boost.org/doc/libs/release/libs/optional/index.html}{boost::optional}, \\ \ccAnchor{http://www.boost.org/doc/html/variant.html}{boost::variant} \\ +\ccAnchor{http://www.boost.org/libs/utility/utility.htm#result_of}{boost::result\_of} \end{ccRefFunction}