19 Jul
2009
19 Jul
'09
1:54 a.m.
Alexander Lamaison
I can obviously cast the 0 constant to an unsigned it but it's getting tedious doing this every time. Surely there must be a better way?
1. Use 0U 2. Define ULONG uzero = 0; and use it in comparisons. 3. Define your own macros which take 2 args, cast to right type one of them and forward them to BOOST_CHECK_EQUAL.
Is there some way to force the comparison to interpret constants as being of whatever type they are being compared to?
How can I know which one is constant? What is the correct type out of 2? Type of left argument or right? I thought about automatic type promotion at some point, but never came up with reasonable design. Gennadiy