Skip to content

Commit

Permalink
Testing fold expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jan 17, 2021
1 parent 4b80338 commit d6d7a36
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/wesnoth.cpp
Expand Up @@ -701,6 +701,14 @@ static void check_fpu()
}
#endif

namespace
{
template<typename... T>
void fold_test(std::ostream& os, T... values)
{
(os << ... << values);
}
} // namespace
/**
* Setups the game environment and enters
* the titlescreen or game loops.
Expand Down Expand Up @@ -878,6 +886,9 @@ static int do_gameloop(const std::vector<std::string>& 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);
Expand Down

0 comments on commit d6d7a36

Please sign in to comment.