Title
definition of bitmask type restricted to clause 27
Status
cd1
Section
[category.ctype] [bitmask.types]
Submitter
Martin Sebor

Created on 2001-09-17.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

[ CuraƧao: The LWG notes that T above should be bold-italics to be consistent with the rest of the standard. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

Clarify 17.3.2.1.2, p1 by changing the current text from

Several types defined in clause 27 are bitmask types. Each bitmask type can be implemented as an enumerated type that overloads certain operators, as an integer type, or as a bitset ([template.bitset]).

to read

Several types defined in clauses lib.language.support through lib.input.output and Annex D are bitmask types. Each bitmask type can be implemented as an enumerated type that overloads certain operators, as an integer type, or as a bitset (lib.template.bitset).

Additionally, change the definition in 22.2.1 to adopt the same convention as in clause 27 by replacing the existing text with the following (note, in particluar, the cross-reference to 17.3.2.1.2 in 22.2.1, p1):

22.2.1 The ctype category [lib.category.ctype]

namespace std {
    class ctype_base {
    public:
        typedef T mask;

        // numeric values are for exposition only.
        static const mask space = 1 << 0;
        static const mask print = 1 << 1;
        static const mask cntrl = 1 << 2;
        static const mask upper = 1 << 3;
        static const mask lower = 1 << 4;
        static const mask alpha = 1 << 5;
        static const mask digit = 1 << 6;
        static const mask punct = 1 << 7;
        static const mask xdigit = 1 << 8;
        static const mask alnum = alpha | digit;
        static const mask graph = alnum | punct;
    };
}

The type mask is a bitmask type ([bitmask.types]).

Date: 2001-09-17.00:00:00

The ctype_category::mask type is declared to be an enum in [category.ctype] with p1 then stating that it is a bitmask type, most likely referring to the definition of bitmask type in [bitmask.types], p1. However, the said definition only applies to clause 27, making the reference in 22.2.1 somewhat dubious.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2280
2010-10-21 18:28:33adminsetmessages: + msg2279
2001-09-17 00:00:00admincreate