Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #12429

Re: c_str from anonymous std::string

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 <ian-news@hotmail.com>
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> (permalink)
References <381e2339-377a-4969-bf8a-7613b811632f@gl2g2000vbb.googlegroups.com> <b919c4e6-cd44-4695-ad09-3e0161de441f@y18g2000yqy.googlegroups.com> <jc63b5$3iu$1@dont-email.me>
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 <jc63b5$3iu$1@dont-email.me>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:12429

Show key headers only | View raw


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

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

c_str from anonymous std::string Andrew Tomazos <andrew@tomazos.com> - 2011-12-11 23:57 -0800
  Re: c_str from anonymous std::string SG <s.gesemann@gmail.com> - 2011-12-12 00:10 -0800
  Re: c_str from anonymous std::string Goran <goran.pusic@gmail.com> - 2011-12-12 00:21 -0800
    Re: c_str from anonymous std::string "MikeWhy" <boat042-nospam@yahoo.com> - 2011-12-12 17:39 -0600
      Re: c_str from anonymous std::string Tobias Müller <troplin@bluewin.ch> - 2011-12-13 07:13 +0000
      Re: c_str from anonymous std::string Juha Nieminen <nospam@thanks.invalid> - 2011-12-13 07:38 +0000
      Re: c_str from anonymous std::string Ian Collins <ian-news@hotmail.com> - 2011-12-13 20:49 +1300
      Re: c_str from anonymous std::string Andrew Tomazos <andrew@tomazos.com> - 2011-12-13 02:19 -0800
        Re: c_str from anonymous std::string "MikeWhy" <boat042-nospam@yahoo.com> - 2011-12-13 11:10 -0600
          Re: c_str from anonymous std::string Andrew Tomazos <andrew@tomazos.com> - 2011-12-13 10:17 -0800

csiph-web