Quote:Original post by NypyrenQuote:Original post by Dragon_StrikeQuote:Original post by Nypyren
Would using inheritance work for you instead?
im sorry i forgot to mention the regular types should also be used... i could make wrappers for all the types that i need though... but it seems like a quite ugly solution.. or?
EDIT:: Im using C++
You'll have to make a separate class_function for every single type anyway, so making wrappers isn't THAT ugly.
well ill have to create a class initialization, constructor, variable and set function for every available type... thats for me 7 lines for each type... instead of only one (function)... but sure its acceptable...
but i think a solution with some kind of union type would make the code alot more readable and understandable...
EDIT:: and id also have to add one function each for adding it to the list since i have to know the type of the variable that is sent to the class to create and store the appropriate wrapper