Hi
I have a code as follow:
template<class T>
inline bool IsValidUnsignedLong(T n)
{
return (T)(unsigned long) n == n;
}
When I pass -l to that function, it returns TRUE which it shouldn't since its not unsigned. Can anyone explain to me the reason behind this? why am I getting TRUE instead of FALSE. I know it has something to do with casting but I can't see/find the reason.
Thanks in advance.
--
Mark