2012-04-14から1日間の記事一覧

union の const メンバ

ここに何の変哲もない union があったとする。 union point { struct { short x; short y; }; int hash; }; int のサイズとかは今回は置いといて、これを immutable にしたい。const 付ける。 union point { struct { const short x; const short y; }; cons…