Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!rutgers!princeton!allegra!alice!bs From: bs@alice.UUCP Newsgroups: comp.lang.c++ Subject: Re: Address of constructor? Message-ID: <6438@alice.uUCp> Date: Sun, 7-Dec-86 22:16:34 EST Article-I.D.: alice.6438 Posted: Sun Dec 7 22:16:34 1986 Date-Received: Mon, 8-Dec-86 03:26:44 EST References: <165700002@uiucdcsb> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 20 Summary: you cannot take it Kevin Kenny writes > In working over the material of the previous posting, removing any > references to overloaded functions, I discovered that I couldn't find > a syntax that cfront would accept for taking the address of a > constructor. I want to do this because I am in a situation where I > have allocated memory by another means that I want to initialize as an > instance of a class, so I want to pass it to the constructor as > ``this''. The reason why is complicated; suffice it to say that I am > dealing with a situation where I can't rewrite the constructor and > have to use a memory allocator other than the standard _new operator. That sounds messy - and no, there is no way of taking the address of a constructor, if you must play games with allocation and initialization that separates the two you will have to do something like providing a separate ``init()'' function and pass the address of it. If you cannot even do that I think you will have to avoid user-defined allocation. Similarly for destructors.