PTypes: cset: manipulation

Top: Basic types: cset: Manipulation

>     #include <ptypes.h>

>     void   assign(cset& s, const char* setinit);
>     string asstring(const cset& s);
>     void   clear(cset& s);
>     void   fill(cset& s);
>     void   include(cset& s, char b);
>     void   include(cset& s, char min, char max);
>     void   exclude(cset& s, char b);

assign(cset& s, const char* setinit) works the same way as cset(const char*) constructor (see constructors).

string asstring(const cset& s) returns a string representing the given set s using cset(const char*) syntax. Typically used for debugging.

clear(cset& s) assigns an empty set (removes all members) to the set s.

fill(cset& s) assigns all 1s to the set - all elements become members of this set.

include(cset& s, char b) adds the element b to the set s. Equivalent to s += b.

include(cset& s, char min, char max) adds a range of elements min through max to the set s.

exclude(cset& s, char b) removes the element b from the set s. Equivalent to s -= b.

See also: Constructors, Operators

PTypes home