Usage of INT_MAX, etc.
Simon Hausmann
hausmann at kde.org
Wed Oct 25 07:00:47 BST 2006
On Wednesday 25. October 2006 00:28, Thiago Macieira wrote:
> Jaroslaw Staniek wrote:
> >What I now propose is to make docs and function signatures shorter by
> > defining things like
> >
> > #define INT32_MAX numeric_limit<int32_t>::max()
>
> Only in docs.
>
> Don't define that in C++ code, since that requires int32_t, which isn't
> always present. It also requires #include <limits> and "using namespace
> std;"
>
> Also note that you don't need to define INT32_MAX to a call to
> numeric_limit::max. For 32 bits exactly, MAX is (2^31)-1 and MIN
> is -(2^31).
>
> So I feel this #define is unnecessary.
I agree with Thiago. I don't see what problem it actually solves, since int is
32 bit on all platforms we support.
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061025/8fe5e291/attachment.sig>
More information about the kde-core-devel
mailing list