I have various functions with two int arguments (I write both functions and the call code myself). I am afraid to confuse the order of argument in some calls.
How can I use type safety so that the compiler warns me or makes an error if I call a function with the wrong sequence of arguments (all arguments are int)?
I tried typedefs: Typedef does not run any warnings or compiler errors:
typedef int X; typedef int Y; void foo(X,Y); X x; Y y; foo(y,x);
c ++ type-safety
Andrei
source share