From 978b6a8724c38c03e2eb07c6ac5c4f3c146e9d09 Mon Sep 17 00:00:00 2001 From: Sage King Date: Sun, 7 Aug 2022 16:56:13 -0600 Subject: [PATCH] Added comment explaining obscure folding syntax in NetPlayServer.cpp --- Source/Core/Core/NetPlayServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 9ea4555ca5..0d59486423 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -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_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_to_send)); SendToClients(response);