flag variable

do anyone know what is flag variable?
A flag variable is a variable that can hold
1. any one of a mutually exclusive set of constant values eg. either true or false or
2. any combination of of values from a set of constant values.

In C++ , the type of a flag variable that can hold any combination of of values from a set of constant values is usually a BitmaskType http://en.cppreference.com/w/cpp/concept/BitmaskType

In std::basic_ostream<>::seekp( off_type off, std::ios_base::seekdir dir ), dir is a flag variable:
it can be one of std::ios_base::beg, std::ios_base::cur, std::ios_base::end
http://en.cppreference.com/w/cpp/io/basic_ostream/seekp

An example of a BitmaskType is std::ios_base::fmtflags: http://en.cppreference.com/w/cpp/io/ios_base/fmtflags
Topic archived. No new replies allowed.