From: Claus Fischer Newsgroups: gnu.gcc.help,comp.os.os2.programmer.misc,comp.os.msdos.djgpp Subject: Re: C++ constructor problem solved!! Read how, it might come in useful in your future programs! Date: 20 Jan 1998 08:45:59 -0800 Organization: Intel Corporation Lines: 24 Message-ID: References: <34C2817A DOT 5547BE86 AT alcyone DOT com> NNTP-Posting-Host: tcadcs6.sc.intel.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gili wrote: > I found a second (and perhaps better) way of doing this. Now I use > "this->fstream.fstream(". Perhaps this should be questioned in a standards newsgroup to completely clarify it; however, I want to guard you; even though this might work for a current version of your C++-compiler, it's quite likely not going to work for the final version. No matter which syntax you use to refer to fstream::fstream() as a constructor - and the above form is just a syntactical variation of accessing the constructor function - the compiler will probably be required by the standard to create a temporary object. I think, therefore, that the only reliable form to use the constructor explicitely would be one of the alternatives suggested by previous posts: either using a pointer to an external allocated fstream object, or using the special form of try syntax which has been suggested by a person who is apparently more knowledgeable in C++ than me:-) Claus Fischer Not speaking for Intel.