Pelish/pvpgn — comment on commit aba85456ac0f2445106c29af27341040fbbe8a09
File: pvpgn/src/bnetd/handle_wol_gameres.cpp line 631
By d1zzy:

It seems weird to have to write so many functions that look similar. I propose this solution: Use a template function to generate the functions for every value so, replace the various _client_fooN with:
template
static int _client_foo_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) {
return _cl_foo_general(N, type, size, data);
}

And then in the table, have the various instantiations of the template:
{CLIENT_CR0_UINT, &_client_cra_generic<0>},
{CLIENT_CR1_UINT, &_client_cra_generic<1>),
...