Hi.
I was jumping around one of my strange ideas and I was wondering if anyone has any thoughts about this.
The idea is that I have an abstract data type called Data. That data can hold any kind of primitive type: int, char, boolean and so on. I have an estabilsh method for each data type, let's say setValueAsChar, setValueAsInt and so on ...
I was wondering if there was any way to include this in a single method. This is possible with class tupes, that can be encapsulated as objects, but didn't find a way for primitive.
The objective is not to write a bunch of methods with the same code for each functionality on the data type.
Cheers,
Dian
I was jumping around one of my strange ideas and I was wondering if anyone has any thoughts about this.
The idea is that I have an abstract data type called Data. That data can hold any kind of primitive type: int, char, boolean and so on. I have an estabilsh method for each data type, let's say setValueAsChar, setValueAsInt and so on ...
I was wondering if there was any way to include this in a single method. This is possible with class tupes, that can be encapsulated as objects, but didn't find a way for primitive.
The objective is not to write a bunch of methods with the same code for each functionality on the data type.
Cheers,
Dian