Jose Abilio Oliveira Matos <[EMAIL PROTECTED]> writes:

| > working with bit representations. And by using it you get no type
| > checking on the enum type.
| 
|   The the "C++ Programming Language" refers bitset to other uses, such as
| having parameters with boolean flags, not only for bit operations.

        From the same chapter:
         "If you want to name the bits, rather than numbering them,
         "using a set(§17.4.3), an enumeration (§4.8), or a
         "bitfield (§C.8.1) are alternatives."

And we want to name the bits, and have the confined in a type.

| The advantage of bitset over sets, for small sizes, is that you have an easy
| way to find if the element is in the set or not.
| That is what is needed where, the implementation with enums just says the same thing.
| 
|   This is the (only) point where I disagree with you. Bitsets are apropriate
| for this job, IMHO. :-)

Not ideal.

-- 
        Lgb

Reply via email to