Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] "unite" operation in MinKowski_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] "unite" operation in MinKowski_2


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] "unite" operation in MinKowski_2
  • Date: Mon, 16 May 2011 15:44:49 +0200 (CEST)

On Mon, 16 May 2011, Sebastien Loriot (GeometryFactory) wrote:

The problem you have comes from the fact that x() and y() don't return
references. Due to the type_equality_wrapper (the mechanism making Kernel::Point_2 and Point_2<kernel> being compatible), a reference to
a temporary is returned at some point.

You should write:
const MP_FT& x() const {return *pos;}
const MP_FT& y() const {return *(pos+1);}

Or provide your own Compute_x_2 functor, as having a reference return type in the wrapper depends on the Compute_x_2 functor deriving from Has_qrt (but indeed returning the type by reference is better).

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page