21 авг. 2014 г., в 13:17, Milian Wolff <[email protected]> написал(а):

On Thursday 21 August 2014 13:13:15 Иван Комиссаров wrote:
>> Of course, i can:)
>> 
>> bool ok;
>> const int value = string.toInt(&ok);
>> if (ok)
>>    qDebug() << "value is" << value;
>> 
>> // ====
>> const auto value = string.toInt();
>> if (value)
>>    qDebug() << "value is" << *value;
> 
> This is a source-incompatible change (and the bool* ok = 0 is optional). You 
> cannot add such an API in Qt 5. You'd need to chose a different name.
> 

The idea is to reimplement private functions for now; QString was an example of 
such function.

> While I agree that the existing API is not nice, coming up with new names 
> won't be much nicer. In Qt 6, I we can just use std::optional and similar. In 
> Qt 5, personally, I'd say lets stick with what we have and not try to 
> reinvent 
> yet another part of the STL.
> 
> But that's just me.

We can't wait that long when committee will accept std::optional. Are you sure 
it would get into c++14? I'm not. Next, when will MSVC support c++14? It still 
has no support for constexprs and unicode literals, AFAIK. More, Qt has to 
support ancient stuff like WinCE which is only supported by studio 2008.
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to