I need to create 10 functions that are very long and identical in every way except for a single line of code in each function. This single line of code is a function call. Is there a way to condense into one function? ex.
int doSomethingOne()
{
...
one();
...
}
int doSomethingtwo()
{
... // same as one
two();
... // same as one
}
You could create a function template doing all the common parts and calling a user-provided function in the middle of it all:
Output: