Writing unions as classes instead of unions to allow non POD types