I'm writing a matrix class, and I want it to be able to store any different (numerical) data type - from boolean to long.
In order to access the data I'm using the brackets operator. Is it possible to make that function return different data types depending on which data type is stored within the class. What's MORE is that I'm not entirely sure how I would STORE different data types within the class under the same variable name. It may well not be possible.
The only way I can think to store the data as any type would be to store it as a void and store the type of data as an extra variable. however RETURNING as a void would cause problems, no? Because I would want to return as the data type I have stored in the function.
Thanks.