combine different data type

Simen Kjærås simen.kjaras at gmail.com
Mon Jan 30 07:03:34 PST 2012


On Mon, 30 Jan 2012 13:58:38 +0100, sami <sami at hotmail.com> wrote:

> when i do that auto x = [1, "ha"];
> i have an error Error: incompatible types for ((1) ? ("hgh")): 'int' and  
> 'string'
> if there any method to combine different data type?

You might want to check out std.variant. It's Variant type can hold any
type you may want.


More information about the Digitalmars-d-learn mailing list