How to correctly initialize it?
std::set set;
The only condition is that YourType
must have bool operator<(const YourType&) const
and by copyable (default constructor + assignment operator). For std::vector
copyable is enough.
How to insert them correctly.
set.insert(my_elem);
How to get specific object (for example object, which has name variable in it, which is equal to "ben") from set?
That's maybe the point. A set is just a bunch of object, if you can just check that an object is inside or iterate throught the whole set.