Basically, I want to choose addition if add equals true and subtraction otherwise, without having to rely on creating structs, functions or switches, because it makes for less code. Is this possible?
Does this meet your requirements? I think std::function is easier than directly dealing with function pointers, but you should be able to turn it into a raw function pointer array if you need to.
Edit: Actually, I'm not sure of a "nice" way to make it work with raw pointers, but I bet something exists. But really, std::function has much nicer syntax.
I didn't know that the standard library had function wrappers defined for addition and subtraction. That was exactly what I was looking for. Some compilers (like the latest version of Xcode) seem to have these functions integrated in iostream, making the functional include unnecessary. One can make it work with raw pointers by implementing their own addition/subtraction functions and then pointing to those functions.