[Interest] Creating a QVariant of QList<QObject*> knowing only the class name

Thiago Macieira thiago.macieira at intel.com
Thu Feb 23 09:03:03 CET 2017


On quarta-feira, 22 de fevereiro de 2017 23:58:29 PST Thiago Macieira wrote:
>         int x = abs(getValue1()),
>             y = abs(getValue2());
>         if (x * y < x)
>                 throw overflowError();
> 
> According to the standard, the exception above can never be thrown.

No, sorry, the code above has one valid code path that leads to the exception: 
if y is 0.

But it does not check for overflow.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list