I'm trying to dissect this websocket++ example https://github.com/zaphoyd/websocketpp/blob/experimental/examples/broadcast_server/broadcast_server.cpp
At line 126, there is typedef std::set<connection_hdl,std::owner_less<connection_hdl>> con_list;
. I'm wondering why it isn't merely typedef std::set<connection_hdl> con_list;
.
I've read How does the Comma Operator work and http://en.cppreference.com/w/cpp/memory/owner_less but I'm not sure what the purpose is.
What is actually stored in the std::set
? What does std::owner_less
actually do? What is the purpose of making a container with this structure instead of storing the connection_hdl
s themselves?