14 Feb
2017
14 Feb
'17
5:26 p.m.
On 02/13/2017 05:41 AM, Gavin Lambert via Boost-users wrote:
I don't think it's generally considered a good idea to test anything other than integers using bitwise operations, no.
The main advantage of bitwise comparison of integers (compared to operator==) in Boost.Test to me is that the error message clearly says which bit is wrong. I'd prefer this advantage for any type, though I see a reason to not allow this type of comparison (especially for floating point numbers). In case of serialization of arbitrary values a bitwise comparison might come handy, though the workaround with reinterpret_cast is easy enough to do in the rare cases one really wants bitwise comparison for non-integer types. Thanks for your remarks. Norbert