From aec07c1fe2494c7cf7700b3fde17e9b97bfb01f5 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Tue, 29 Jul 2008 12:01:35 +0000 Subject: [PATCH] Use object_cast instead of assign in the example --- Kernel_23/doc_tex/Kernel_23_ref/intersection.tex | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex index 7ab44946471..18012da4c2a 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex @@ -338,25 +338,21 @@ The following example demonstrates the most common use of void foo(CGAL::Segment_2 seg, CGAL::Line_2 line) { - CGAL::Object result; - CGAL::Point_2 ipoint; - CGAL::Segment_2 iseg; - - result = CGAL::intersection(seg, line); - if (CGAL::assign(ipoint, result)) { + CGAL::Object result = CGAL::intersection(seg, line); + if (const CGAL::Point_2 *ipoint = CGAL::object_cast >(&result)) { \end{verbatim}% \ccHtmlLinksOff% \begin{verbatim} - // handle the point intersection case. + // handle the point intersection case with *ipoint. \end{verbatim}% \ccHtmlLinksOn% \begin{verbatim} } else - if (CGAL::assign(iseg, result)) { + if (const CGAL::Segment_2 *iseg = CGAL::object_cast >(&result)) { \end{verbatim}% \ccHtmlLinksOff% \begin{verbatim} - // handle the segment intersection case. + // handle the segment intersection case with *iseg. \end{verbatim}% \ccHtmlLinksOn% \begin{verbatim}