Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Problems updating Poin_d's memebers

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Problems updating Poin_d's memebers


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Problems updating Poin_d's memebers
  • Date: Thu, 3 May 2012 23:37:14 +0200 (CEST)

On Thu, 3 May 2012, Philipp Moeller wrote:

I can confirm the same on a recent gcc. Looks like a bug in
Lazy_exact_nt to me. Point_d::operator[] returns by value as documented
but assignment does work for some unknown reason.

Why wouldn't it?

struct A {};
A f(){return A();}
void g(){ f()=A(); }

operator= is a member function like any other.

The operation is forbidden for builtin types, or if f returns const A (used to be a popular technique), or in C++11 if operator= has a '&' at the end of its declaration.

If operator[] should really return by value is another issue. It is
certainly necessary for a Homogeneous kernel, but not a Cartesian. Seems
wasteful in case of a ref counted NT representation.

An important point of ref-counting in CGAL is not to care about this. It is for non-ref counted types that it is wasteful.

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page