Boost logo

Boost :

Subject: Re: [boost] [Library idea] Type-safe Flagsets
From: degski (degski_at_[hidden])
Date: 2018-06-27 04:42:21

On 27 June 2018 at 02:37, Gavin Lambert via Boost <boost_at_[hidden]>

> On 27/06/2018 01:41, degski wrote:
>> Once one has adopted the idea of "flags" to possibly not exist, i.e. not
>> to
>> be either true or false, a natural extension is to adopt "fuzzy flags" as
>> well, i.e. use floats. Some bike-shedding: I think the word flags is not
>> sufficiently general.
> At this point you've sufficiently departed the "bitwise operations" model
> to make it fairly meaningless.

 You would implement trits with bitwise operations using BCT (Binary Coded
Ternary: implementation
<>). Ternaries
have some interesting mathematical properties as well, which is explained
here <>. There
are also pratical applications

You'd probably be better served with a regular structure or with
> Boost.ProgramOptions instead.

Did you read the G.O.A.P. link I posted (here's one from MIT
<>)? Because if you had, you
would not suggest to solve this problem with Boost.ProgramOptions.

As to the fuzzy idea, bits are not necessarily digital, think analog

Personally, I think the flags proposal is an instance of over-engineering
and is making things that are fairly simple (and why not use bitfields, the
compiler does the work, certainly better than any had-coded solution)
complicated. It is also a well-known and understood idea.


Boost list run by bdawes at, gregod at, cpdaniel at, john at