[Interest] Support of russian language in QJson-classes

Thiago Macieira thiago.macieira at intel.com
Mon Aug 19 17:27:13 CEST 2013

On segunda-feira, 19 de agosto de 2013 16:29:40, Dmitrii Volosnykh wrote:
>     QFile file("test.json");
>     bool ok = file.open(QFile::WriteOnly | QFile::Truncate);
>     Q_ASSUME(ok);

Hmm... are you sure you know what the Q_ASSUME macro does?

You're using it where I would expect to see Q_ASSERT. For example, file 
creation is something that may fail at runtime. If it does, in the case above, 
your program goes into undefined behaviour after that Q_ASSUME.

You're only supposed to use it when you're *sure* it is always true. 

>From the docs:
    This macro could be considered a "lighter" version of \l{Q_ASSERT}. While
    Q_ASSERT will abort the program's execution if the condition is false,
    Q_ASSUME will tell the compiler not to generate code for those conditions.
    Therefore, it is important that the assumptions always hold, otherwise
    undefined behaviour may occur.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- 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/20130819/263d61d4/attachment.sig>

More information about the Interest mailing list