I would like to combine two types

template Foo(A, B = 4)
{
    union
    {
       byte b = B;
       int a = A << 8;
    }
}

This packs a and b together in to an int bytes, saving an int(rather than storing a and b in an int each) and makes it easier to access.

I get an error about overlapping default initialization. They don't actually overlap in this case because of the shift.

Reply via email to