home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19827 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.1 KB  |  30 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: Friend ..Overload Assignment opertr ..
  5. Message-ID: <1993Jan24.162220.18210@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <1993Jan22.075317.21062@usl.edu> <schmidt.32@rz.uni-passau.de>
  8. Date: Sun, 24 Jan 1993 16:22:20 GMT
  9. Lines: 19
  10.  
  11. schmidt@rz.uni-passau.de (SCHMIDT GUIDO) writes:
  12.  
  13. >operator=() is something like a constructor with built in destructor. You
  14. >can specify as many different constructors for one class as you like.
  15. >Likewise you can do for operator=().
  16.  
  17. operator=() has nothing in common with constructors except that
  18.     both must be member functions
  19.     they may be overloaded
  20. These two things are also true for other unrelated functions.
  21.  
  22. operator=() need not behave in any way like a constructor or destructor.
  23. If such a function exists, it is invoked when a class object is assigned
  24. to (but not when one is initialized).  The function might or might not do
  25. any construction or destruction.  The function is not automatically
  26. invoked by creating or destroying an object.
  27. -- 
  28.  
  29. Steve Clamage, TauMetric Corp, steve@taumet.com
  30.