Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!ukc!hrc63!pjmp From: pjmp@hrc63.co.uk (Peter Polkinghorne) Newsgroups: comp.lang.c++ Subject: Overloading New & Delete, also const Message-ID: <163@hrc63.co.uk> Date: Thu, 7-May-87 05:00:21 EDT Article-I.D.: hrc63.163 Posted: Thu May 7 05:00:21 1987 Date-Received: Sat, 9-May-87 19:34:08 EDT Organization: GEC Hirst Research Centre, Wembley, England. Lines: 23 Keywords: new, delete, const, overloading This is a repost of the first question (since there was no response) with an additional question on consts. We are using v1.1 on Sun 3.2. According to the book reference manual section 8.5.11 (page 282) both new & delete can be overloaded. However having done this, I discover that c++ (or cfront) fails to use the new operators. I can see that this is reasonable for new which is really a "zero-ary" operator :-), but delete is a perfectly normal unary operator. Now having investigated this, I also realise I should use the contructor destructor mechanism for defining my own freestore mechanism. So is the inability to overload new & delete a feature or a bug? The const feature seems to be oddly implemented, since they are GLOBAL variables, not even static. Hence advice in the manual to have const in header files, gives errors with ld (sect 4.3 page 107) of multiply defined variables. Also const does not work in case labels. Are these problems fixed in 1.2? Peter Polkinghorne pjmp@uk.co.gec-rl-hrc or ...!mcvax!ukc!gec-rl-hrc!pjmp GEC Research Wembley "His intimate friends called him 'candle-ends', UK and his enemies 'toasted-cheese'" - Lewis Carroll