What generic type should i use, if I have to assign a Character value to it?
For now I’m using type Char is(<>); at the generic declaration,
and assign the character value like this:
XY:GenericChar;
CharacterVariable: Character:='A';
XY:=GenericChar'Value(Character'Image(CharacterVariable));
It works, but i think there should be a better way.
You could use
'Posand'Val.Converting between non-related enumeration types is non-trivial. Best would be to use a conversion function like:
That way your generic package wouldn’t have to care about converting.
For instantiating the package you would have to create the function.