**Sets** is a freeware C++ class that allows you to create sets of any
type (limited only to the ordinal types, ie. char, int, etc.),
and to use the standard set operations on them. Some operators from Turbo
Pascal have been borrowed.

The operators that can be used are:

Symbol | Meaning | Standard math symbol |
---|---|---|

+, | | union | S1 ∪ S2 |

*, ^, & | intersection | S1 ∩ S2 |

-, ~ | complement | ¬S1 or S1^{∁} |

- | subtraction | S1 ∖ S2 |

<= | subset | S1 ⊆ S2 |

< | proper subset | S1 ⊊ S2 |

>= | superset | S1 ⊇ S2 |

> | proper superset | S1 ⊋ S2 |

== | equality | S1 ≡ S2 |

!= | inequality | S1 ≢ S2 |

note: e <= S can also be used to represent e ∈ S.

Download **Sets**

Last updated August 21, 2001. © Hubert Chan <><