How can one write code so as to fill in the first ellipsis below, so that the legacy code can be given a reduced argument list?:
int main(int argc, char **argv)
{
// extract 1 or more optional arguments
...
// forward remaining
LegacyObject leg(argc_2, argv_2);
}
You can try something like this
The simplest way I can think of is to make a copy of the argument list, filtering out the arguments that the legacy object should not have.
Something like the following pseudo code: