[Interest] Why QString and not std::string?

Thiago Macieira thiago.macieira at intel.com
Fri Jun 15 16:29:22 CEST 2012


On sexta-feira, 15 de junho de 2012 17.46.37, Konstantin Tokarev wrote:
> 15.06.2012, 16:58, "Thiago Macieira" <thiago.macieira at intel.com>:
> > Any one care to give me the Standard Library equivalent of:
> > 
> >         QString::number(x)
> 
> static_cast<ostringstream*>( &(ostringstream() << x ) )->str();

Don't forget the #include, which is <sstream> not <stringstream>.

Last time I tried this, it took me a few minutes to figure out what I had done 
wrong, then find on the internet what the header name was.

(last weekend, while porting Synergy to IPv6)
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120615/f56ed204/attachment.sig>


More information about the Interest mailing list