Path: csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!local2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Tue, 10 Nov 2015 15:13:05 -0600 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Memory and error management approaches References: <6b3ogc-uob.ln1@wilbur.25thandClement.com> <8737wjk1lw.fsf@gmail.com> <0a52aa48-e09d-4f70-82fd-7d5024ef5ba8@googlegroups.com> Date: Tue, 10 Nov 2015 21:13:05 +0000 Message-ID: <877flpv9r2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:sxhaTh3GhhJ0It+9V0WizAKWWtg= MIME-Version: 1.0 Content-Type: text/plain Lines: 18 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-IuJ1pR6eJ9Ft8jcyrB/yLLygVHmsw7aK9PMuUxnHlaRrSt0TsK94XTR/piaevYPb0K76Io8WI3Ox4c6!80U6JlCnaY45wBu3E9tAzb1MF0FkBMHsRZj/0SplTL9E5iAFkUQ+r2/yoj6GBLaIzCpv X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2029 Xref: csiph.com comp.lang.c:75676 Malcolm McLean writes: > It's not that it can't be defined. > > Resource allocation occurs only in constructors, which are only called > when named variables are initialised. Malcolm, not for the first time, you are talking absolute claptrap. [snip claptrap-piled-upon-claptrap]. void foo(void) { std::vector rvec; // no resources allocated for(int i = 0;i < 10;++i) rvec.push_back(rand()); // add resources return; // And ... resources automatically deallocated! RAII! }