mirror of https://github.com/CGAL/cgal
Fixed Kernel_d doc to compile again and to use result_of for
intersections.
This commit is contained in:
parent
9bb495b4bd
commit
17e00293d1
|
|
@ -83,7 +83,7 @@ for more information about this mechanism.
|
|||
Segment s1, s2;
|
||||
std::cin >> s1 >> s2;
|
||||
|
||||
boost::result_of<K::Intersect_2(Segment, Segment)>::type
|
||||
boost::result_of<K::Intersect_d(Segment, Segment)>::type
|
||||
v = intersection(s1, s2);
|
||||
if(v) {
|
||||
/* not empty */
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@ A model for this must provide:
|
|||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMemberFunction{
|
||||
typename
|
||||
boost::result_of<Kernel::Intersect_d(Type1<K>, Type2<K>)>::type
|
||||
operator()(const Type1<K>& p, const Type2<K>& q);}
|
||||
\ccMemberFunction{boost::result_of<Kernel::Intersect_d(Type1<K>, Type2<K>)>::type operator()(const Type1<K>& p, const Type2<K>& 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},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
\begin{ccRefFunction}{intersection}
|
||||
\ccInclude{CGAL/intersections_d.h}
|
||||
|
||||
\ccFunction{Kernel::Intersect_d::Result<Type1<K>, Type2<K> >::Type
|
||||
\ccFunction{result_of<Kernel::Intersect_d(Type1<K>, Type2<K>) >::type
|
||||
intersection(Type1<R> f1, Type2<R> 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 <class R>
|
||||
void foo(Segment_d<R> seg, Line_d<R> lin)
|
||||
{
|
||||
R::Intersect_d::template Result< Segment_d<R>, Line_d<R> >
|
||||
result = intersection(seg, lin);
|
||||
// with C++11 support
|
||||
auto result = intersection(seg, lin);
|
||||
|
||||
// without C++11 support
|
||||
// typename boost::result_of<R::Intersect_d(Segment_d<R>, Line_d<R>)>::type
|
||||
// result = intersection(seg, lin);
|
||||
|
||||
if(result) { boost::apply_visitor(Intersection_visitor<R>(), *result); }
|
||||
else { /* no intersection */ }
|
||||
}
|
||||
|
|
@ -176,6 +181,7 @@ void foo(Segment_d<R> seg, Line_d<R> 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}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue