Include the header with #include and declare your set: set words; creates an empty set that will hold strings. Elements will be stored in alphabetical order. Initialize with values directly: set nums = {3, 1, 4, 1, 5}; creates a set containing {1, 3, 4, 5}.
The duplicate 1 is automatically ignored and elements are sorted. Elements must support the < operator for comparison. All built-in types work automatically. For custom types, you'll need to define the operator or provide a custom comparator.