Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

Bitmask Types

Library:  Input/output

Local Index

No Entries

Summary

A Bitmask type is an integer type, including an enumerated type or an assignable, copy constructible, and equality comparable class type, for which the following bitwise operators are defined:

Distinct values of a bitmask type such that for any pair Ci and Cj, (Ci & Ci) != T() and (Ci & Cj) == T(), are elements of the bitmask type. Informally speaking, no two elements of a bitmask type have any overlapping bits.

Note that since a bitmask type need not be implemented as an integer type, there may not be an implicit conversion from an integer type to a bitmask type. Specifically, assigning any integer to a bitmask type need not be well-formed and may cause compilation errors. In order to initialize an object X of a bitmask type T to have none of its bits set, the object should be initialized as follows: T X = T () (not T X = 0).

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Library Introduction, Section 17.3.2.1.2.



Previous fileTop of DocumentContentsIndex pageNext file