Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: c_str from anonymous std::string Date: Tue, 13 Dec 2011 20:49:35 +1300 Lines: 13 Message-ID: <9koecfFhipU9@mid.individual.net> References: <381e2339-377a-4969-bf8a-7613b811632f@gl2g2000vbb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net rwVuFSJowaDWwtS4F3O2DAd8CcP2nEsOWfbC5pvsLAz2jAiWbr Cancel-Lock: sha1:4y9KdiLCjnXfs7F6wLrvIBJ3BDk= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:6.0.2) Gecko/20111003 Thunderbird/6.0.2 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:12429 On 12/13/11 12:39 PM, MikeWhy wrote: > > It should be further noted that "string(x)" here is an explicit C-style > typecast, syntactically identical to "((std::string)x)", followed by copy > construction of std::string, creating not just one, but *two* temporary > std::string. In addition to the other corrections, there really isn't such a thing as an "explicit C-style typecast". There is a C style cast (witch is always explicit) and there's a type conversion (which is isn't). -- Ian Collins