Subject: Re: [boost] [dynamic_bitset] Comparison operators without assertions
From: degski (degski_at_[hidden])
Date: 2017-05-16 06:49:24
On 15 May 2017 at 23:50, Edward Diener via Boost <boost_at_[hidden]>
> What I have ended up doing is to keep the exact same behavior as before
> when the bitsets are of equal size. When the bitsets are of unequal size,
> if either size is 0 that bitset is less than the other one. If neither size
> is 0 I convert both bitsets to an unsigned long using the already provided
> member function to_ulong() and use those values for the comparison.
A throwing function returning a ulong seem wrong and restrictive (32 bits
on windows). If my bitset was only 32 bits long, I wouldn't use a
dynamic_bitset<> in the first place.
I found that it was completely wrong to do bit-by-bit comparisons when the
> bitsets were not the same size.
Size/length could be the deciding factor in this case.
-- "*Ihre sogenannte Religion wirkt bloÃ wie ein Opiat reizend, betÃ¤ubend, Schmerzen aus SchwÃ¤che stillend.*" - Novalis 1798
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk