I knew that the C ++ template allows functions with different data types to share the same implementation code, but I was wondering if a function has a completely different execution path depends on the data types. Is there any way to do this?
For this, you can simply use overloading, in which case you do not need a template.
void path(int value) { // } void path(string value) { // }