Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Constructors/Destructors

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Constructors/Destructors


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Constructors/Destructors
  • Date: Tue, 08 Jun 2010 15:26:01 +0200

rcco wrote:
First, thank you for your reply. I defined just like in the manual but
modified the My_face for my needs:

template <class Refs>
struct My_face : public CGAL::HalfedgeDS_face_base<Refs> {
CGAL::Color color;

My_face() {
printf("My_face!\n");
}
~My_face() {
printf("~My_face!\n");
}
};

but the output is:

My_face!
My_face!
~My_face!
My_face!
~My_face!
My_face!
~My_face!
My_face!
~My_face!
~My_face!
~My_face!
~My_face!
~My_face!
~My_face!

shouldn't be only 4 "My_face!" printed? And so many "~My_face!"? further
tests show the same for vertex and for halfedges the constructor is called
13 times and destructor prints out 37 messages! What am i doing wrong?

Thanks, Rodrigo

This is probably due to calls to copy constructor I guess.

S.



Archive powered by MHonArc 2.6.16.

Top of Page