
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/03/2010 07:00 PM, Scott McMurray wrote:
if (numeric_limits<T>::is_bounded) { // do something using max() and min() }
That wouldn't even compile if definitions of max and min weren't provided, even though it's perfectly legal and useful.
It will also give compiler warnings in certain compilers about branching on a constant.
Generally the "correct" way is to only compile the max- or min-using code if is_bounded is true, by enable_if, specialization, or some other mechanism.
I was just providing some code pointing out why max and min had to be defined in numeric_limits<xint::integer>, even though they only return zeros. - -- Chad Nelson Oak Circle Software, Inc. * * * -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvfXUwACgkQp9x9jeZ9/wTb8ACfR7pC6jHqPhM8moO2dUwv1fsF niMAn3BC1CTXG3qP4SXlMxVW+AxoFSYb =4jO4 -----END PGP SIGNATURE-----