It depends on the set of data types you want to store. If they are simple, you can make union as advised by Lindley.
If data types are complex, make a base class, and derive other 'data-type'...