Added comment explaining obscure folding syntax in NetPlayServer.cpp

This commit is contained in:
Sage King 2022-08-07 16:56:13 -06:00
parent a12099404e
commit 978b6a8724

View File

@ -2078,6 +2078,7 @@ void NetPlayServer::SendResponseToPlayer(const Client& player, const MessageID m
{
sf::Packet response;
response << message_id;
// this is a C++17 fold expression used to call the << operator for all of the data
(response << ... << std::forward<Data>(data_to_send));
Send(player.socket, response);
@ -2088,6 +2089,7 @@ void NetPlayServer::SendResponseToAllPlayers(const MessageID message_id, Data&&.
{
sf::Packet response;
response << message_id;
// this is a C++17 fold expression used to call the << operator for all of the data
(response << ... << std::forward<Data>(data_to_send));
SendToClients(response);