Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Philipp Moeller <>
  • To:
  • Subject: Re: [cgal-discuss] Problems updating Poin_d's memebers
  • Date: Thu, 03 May 2012 15:16:40 +0200
  • Organization: GeometryFactory

luchia
<>
writes:

> Hallo,
>
> Let assume p = (p_0, ..., p_k) be a point of type CGAL::Point_d<Kernel> with
>
> typedef CGAL::Lazy_exact_nt<CGAL::Quotient&lt;CGAL::MP_Float>>
> Ntype;
> typedef CGAL::Cartesian_d<Ntype>
> Kernel;
>
> Now let assume I want to change the 0<= i-th<= k cartesian coordinate of p.
> So I perform:
>
> p[i] = new_data;
>
> The question is: why the above statement has no effect on p[i]? I mean, why
> after the assignment statment, the value of p[i] does not change? How is
> possible
> to access and modify the members of an object of type Point_d?

All CGAL objects are immutable. A statement like p[i] = new_data; should
result in a compile time error. This could be a bug in Kernel_d. (Which
compiler are you using?)

To assign a new value, just assign a new Point_d object to the old one.

HTH,
Philipp Moeller
GeometryFactory



Archive powered by MHonArc 2.6.16.

Top of Page