[Development] Improving toInt, toLong, etc.

Branislav Katreniak katreniak at gmail.com
Fri Feb 7 10:51:44 CET 2014


>
> > The idea was to silently return a default-constructed type.
>
> I'm not keen on that. Aside from adding extra restrictions to the
> types that the class can be used with as you mention,
> it runs the much more severe risk of masking serious bugs.
>

Returning default-constructed value is heavily used practice in qt api and
it simplifies our code. We (try to) design our code such that
default-constructed value means safe default / failure.

Kind regards
 Brano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140207/4f55b1e7/attachment.html>


More information about the Development mailing list