Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!sun-barr!cs.utexas.edu!uunet!mcvax!kth!draken!bmc1!kuling!fredriks From: fredriks@kuling.UUCP (Fredrik Stax{ng) Newsgroups: comp.lang.c++ Subject: Re: Constructors and new Message-ID: <1022@kuling.UUCP> Date: 3 Jun 89 19:22:01 GMT References: <363@msor0.UUCP> Reply-To: fredriks@kuling.UUCP (Fredrik Stax{ng) Organization: Dept. of Computer Systems, Uppsala University, Sweden Lines: 18 I also had this problem when I tried to implement reference counting. Because I wanted the class to be derivable I couldn't use the malloc hack (and did not want to), but changed the new() function to set the pointer new_last to the last new'ed object. I think there should be a defined way of doing this. I also encountered another problem. I wanted to get the pointer class to behave as a native pointer, but I didn't manage to get -> operator working. If the compiler had recognized the equivalence a->b <=> (*a).b this had been easy. -- Fredrik Stax{ng | C looks like a mix of Algol and TECO. CS Student@Uppsala University | -- KPJ Jaakkola fredriks@kuling.docs.uu.se |