> Well it does now look like that, thought I don't know what's the copy
> constructor (there was a warning from Lars about this cc but I asked him
> for explications and didn't understand them so I just left it asis :)

The copy constructor is something like

  Something::Something(Something const & t)
  {
    // make sure we are an exact copy of t
  }


If it is not defined by yourself, the compiler will provide one
automatically by using the copy constructors of all Something::members.

This is often exactly what is necessary, but it breaks with "naked owning
pointers", since it copies the only _pointer_ itself and does not create a
copy of the item pointed to.

(The same holds true for operator=() btw)

This necessity to manually handle copy construction and assignment (and
destruction) when using "naked owning pointers" is one of the major reasons
why we should used some kind of smart pointer (like boost::shared_pointer)
as class members instead.

Andre'

-- 
André Pönitz ............................................. [EMAIL PROTECTED]
C++-Programmierer gesucht ... Naeheres unter http://mathematik.htwm.de/job

Reply via email to