New answers tagged

2

Shims are wonderful I recommend using a shim to offload all the logic to a function manipulating a list (rather than a pack) of arguments. As a bonus, you'll also be able to push the bulk of the implementation into a .cpp file. Essentially, your goal is to invoke: namespace details { class Argument { public: virtual void print(std::ostream& out) ...


8

General design Currently, your function is defined to have "undefined behavior" if the number of arguments is wrong. This is sub-optimal. Checking is trivial in this case, so report the problem in some way instead of producing strange output. I could make it a run-time error, but that would add run-time cost and thus violate C++'s philosophy of ...


Top 50 recent answers are included