Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: assignment to `this' is deprecated in C++ 2.0 Message-ID: <9448@alice.UUCP> Date: 8 Jun 89 00:55:20 GMT References: <9432@alice.UUCP> <6355@columbia.edu> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 30 In article <6355@columbia.edu>, kearns@read.columbia.edu (Steve Kearns) writes: > What will happen with declaration of a "stack" variable: > { > TypeT T; > ... > } > Does new() get called with some indication that allocation on > the stack is expected? Is new() not called? operator new is not called; only the constructor is. > I assume that when a vector is newed(): > { > TypeT * tp = new TypeT[100] > ... > } > then new gets passed 100*sizeof(TypeT)? Nope -- again, operator new is not called. Array types are effectively built-in types for the purpose of memory allocation, so all requests for array allocation and deallocation go through the built-in allocator. -- --Andrew Koenig ark@europa.att.com