I was working on using parameter packs in the ODE solves and there seems to be a conflict between default arguments and parameter packs as they’re implemented in C++ that I guess we should talk about.
So we either do functions where we do the parameter packs first:
f(T_Args... args, double optional1 = 0.0, double optional2 = 0.0)
Or ones with the parameter packs second:
f(double optional1 = 0.0, double optional2 = 0.0, T_Args... args)
If we do the first, C++ won’t automatically deduce T_Args for us.
If we do the second, then any time we provide args, we have to provide values for all the optional args.
The first seems better since we always have type information. It’s a bit annoying though, and if nothing changed then we know we’ll have problems in the future if Stan ever supports type deduction in the language itself.