Newsgroups: comp.lang.c++
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!geech.gnu.ai.mit.edu!rjc
From: rjc@geech.gnu.ai.mit.edu (Ray Cromwell)
Subject: Question about C++
Message-ID: <1991Apr11.181205.22641@mintaka.lcs.mit.edu>
Sender: news@mintaka.lcs.mit.edu
Organization: The Internet
Date: Thu, 11 Apr 91 18:12:05 GMT
Lines: 24

   I have been studying C++ source lately and I've noticed an odd
construct in some type declarations.

 For instance in Complex.h you see member functiuons declared as:
   Complex& Complex(double re, double im);
         ^^

  Is this just a new formatting style encouraged in C++ or a new
use of the & operator. Why not write:  
   Complex &Complex(double re, double im);

  Or
   Complex *Complex(double re, double im);

  Could someone explain the difference. Both declarations return a 
reference to a class Complex. Does it have something to do with the
calling method? (Complex.function() vs Complex->function()) ?


--
/~\_______________________________________________________________________/~\
|n|   rjc@albert.ai.mit.edu   Amiga, the computer for the creative mind.  |n|
|~|                                .-. .-.                                |~|
|_|________________________________| |_| |________________________________|_|
