Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!ncrlnk!ncrcae!ncr-sd!hp-sdd!ucsdhub!ucsd!rutgers!apple!bloom-beacon!mit-eddie!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!ssc!mcgp1!fst From: fst@mcgp1.UUCP (Skip Tavakkolian) Newsgroups: comp.lang.c++ Subject: constructor() as ``new'' operand. Please explain Keywords: new, constructors, c++ Message-ID: <1614@mcgp1.UUCP> Date: 11 Oct 88 01:20:35 GMT Article-I.D.: mcgp1.1614 Organization: Computer Tools Int'l Inc. Lines: 30 I need an explanation on how to verbalize (visualize) use of a constructor as an operand to new operator. In section 5.4.3 of ``the C++ programming language'' [B. Stroustrup, reprint July, 1987] you'll find the following: class set { struct setmem { int mem; setmem *next; setmem(int m, setmem *n) { mem=m; next=n; } }; setmem *first; public: set() { first = 0; } insert(int m) { first = new setmem(m, first); } // ... }; There is no apparent return value from ``setmem'' constructor (i.e. setmem(int, setmem*) ). Where does the operand for new come from. I believe this is correct, I am just trying to visualize how the compiler interprets this. Many Thanks -- Fariborz ``Skip'' Tavakkolian UUCP ...!uw-beaver!tikal!mcgp1!fst UNIX is a registered trademark of AT&T