[Interest] Why QString and not std::string?
Konstantin Tokarev
annulen at yandex.ru
Fri Jun 15 16:18:59 CEST 2012
15.06.2012, 17:50, "Giuseppe D'Angelo" <dangelog at gmail.com>:
> On 15 June 2012 14:35, Sven Anderson <Sven.Anderson at snom.com> wrote:
>
>> On 15.06.2012 14:58, Thiago Macieira wrote:
>>> Any one care to give me the Standard Library equivalent of:
>>>
>>> QString::number(x)
>> string to_string(int) ?
>
> No go, C++11 only.
#if NO_CXX11_AVAILABLE
std::string to_string(int x)
{
std::static_cast<std::ostringstream*>( &(std::ostringstream() << x ) )->str();
}
#endif
--
Regards,
Konstantin
More information about the Interest
mailing list