Usage of INT_MAX, etc.

Thiago Macieira thiago at
Tue Oct 24 20:52:38 BST 2006

Simon Hausmann wrote:
>From Qt's perspective INT_MAX and friends are perfectly fine. Don't look
> at qinputdialog.h as reference :). limits.h is included in various
> public header files and for example qlayoutitem.h uses INT_MAX.
>I don't think another level of indirection buys us anything here :)

There's also std::numeric_limits<T>, which may be easier to use if you 
don't know what your q-type is.

For instance:
works, even if you don't know if qulonglong should be ULONG_MAX or 

#include <limits>

  Thiago Macieira  -  thiago (AT) - thiago (AT)
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list