Is it possible in C++ to use some sort of identifiers akin to function arguments to overload functions? This would allow easier use with templates. It would also make the code look nicer for my particular case, which I'm not explaining in detail.
In case that didn't make much sense, and I honestly don't even know the right keywords for this (please let me know), here's a toy example:
I want writing something like this
function(i);
function(special_action);
function(special_action_2);
being understood like this
function(i);
function_special_action();
function_special_action_2();
What is the best way of achieving this? So far, I have tried doing dummy enums like this:
// normal action
void function(int i) { ... }
// special actions
enum dummy_enum_for_special_action { special_action };
void function(const dummy_enum_for_special_action & dummy) { ... }
I'm guessing the parameter passing will be optimized away by the compiler. Is there, however, a better way of doing this?