Skip to main content

Hot answers tagged

4votes

How to combine multiple functions into a single template based function

It is impossible for us to tell if there is a better way for merging such two similar but not identical functions without knowing the details of the actual functions and how the differences cam about. ...
Bart van Ingen Schenau's user avatar
2votes

How to combine multiple functions into a single template based function

In my experience, the easiest way to have a template that does specific things for one particular type is overloading. void PrintDebugInfo(std::list<int>& obj1, std::list<int>& ...
Sebastian Redl's user avatar
1vote

How to combine multiple functions into a single template based function

Sure, combine to reuse by splitting them: result = FindMaxDistanceList(obj1, obj2); if (_DEBUG_ENABLED_) PrintDebugInfo(obj1, ob2); This way, each call site gets to decide what to print, and ...
Basilevs's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible

close