
"Daniel James" <daniel@calamity.org.uk> wrote
When running your tests, the intel linux compiler gives this warning:
main.cpp(143): warning #858: type qualifier on return type is meaningless const int cf();
which means that BOOST_TYPEOF_PRESERVE_LVALUE(cf()) gives int, and your test fails, so you might want to remove that test.
Removed.
Also neither encode_signed nor encode_unsigned seem to work for zero values. I think encode_signed is missing a check for zero, and I guess encode_unsigned should add 1 to value when encoding, and then subtract 1 when decoding - or have a special case like encode_signed does.
Fixed. I actualy re-wrote the integral encoding part, taking more bit-wise approach, which allowed me to handle all integral types (signed, unsigned and boolean) an a uniform manner. I encode 4-byte types using two integers (because of zero, and also limitations on the array size I ran into in GCC), and shorter types using just one. I also switched from mpl::int_ to mpl::size_t. http://groups.yahoo.com/group/boost/files/typeof.zip Thanks, Arkadiy