From d6d7a36dfa7d3490793e5f6659e54b8445607d29 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Mon, 18 Jan 2021 08:36:37 +1100 Subject: [PATCH] Testing fold expressions --- src/wesnoth.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wesnoth.cpp b/src/wesnoth.cpp index 3a8e7441b266..3e6611816a5e 100644 --- a/src/wesnoth.cpp +++ b/src/wesnoth.cpp @@ -701,6 +701,14 @@ static void check_fpu() } #endif +namespace +{ +template +void fold_test(std::ostream& os, T... values) +{ + (os << ... << values); +} +} // namespace /** * Setups the game environment and enters * the titlescreen or game loops. @@ -878,6 +886,9 @@ static int do_gameloop(const std::vector& args) cursor::set(cursor::NORMAL); + std::ostringstream test; + fold_test(test, 1, 2, 3, 4, 5); + // If loading a game, skip the titlescreen entirely if(game->has_load_data() && game->load_game()) { game->launch_game(game_launcher::reload_mode::RELOAD_DATA);