Good evening Dear Arduino Community,
I want to understand some specifics regarding method overloading. Consider the following criteria:
a) void task_x(Int a){convert to char and send through serial}
b) void task_x(Int a, Int b){convert to chars in sequence and send through serial}
c) void task_x(Int a, Int b, Int c){convert to chars in sequence and send through serial}
... extending further for more int overloading, say 10 more ints.
I understand that overloading criteria consider differentiation in types and argument count. The proposed overloading is differentiated only by the number of int arguments for the sake of simplicity as you can see.
For the purpose of this example, consider that the values received as arguments need to be received and converted in sequence (int a, b, c, d, e....considering further overloading) to serialize for some other function; thus the order of the received arguments counts. (I don't have a coded example yet).
The idea is to overload a method that an user can recycle given different choices of parameters in a sequence to pass as arguments to the method, but skipping certain positions in the arguments passed on to the function.
Is it possible to create a way to apply a "selective" overloading for a user choice based on example criteria int a, int c, alone? skipping the int b? this without forcing the user to write a value on the int b to force the overloading choice c).
Surely I could be stretching the interpretation of the use of overloading incorrectly? If so, please point out a method to apply selective argument discrimination while still applying overloading, or otherwise the correct methodology to apply this criteria using the same method name.