N
Nick Keighley
Frederick said:jaysome posted:
[testing an unsigned against -1]
If I was writing C++ code, I'd have the choice of:
numeric_limits< Type >::max()
But nonetheless I'd still use -1.
As for the warning sending chills up your spine, you can always cast it
away:
i != (unsigned)-1;
or, in C++:
i != implicit_cast<unsigned>( -1 );
is this a new type of cast?
--
Nick Keighley
"Using a 64-bit value introduces a new wrap around date in about 290
billion
years, on Sunday, December 4, 292,277,026,596 15:30:08 UTC. This
problem is
not, however, widely regarded as a pressing issue."
wiki/Year_2038_problem