There is another possibility. Perhaps you think you want a variant type, but in reality there is another completely different way to approach the problem. We don't know what your actual situation is, so we can't say one way or the other. You might want to think about your design again. Maybe research some design patterns and see if one of them might fit the bill and give you a way to avoid the need for the variant type.