2019-04-28から1日間の記事一覧

reinterpret_cast は参照に対しても使用できる【C++】

C++

reinterpret_cast はポインタの型変換を行うという説明をよく目にします。 しかし、それだけではなく参照のキャストも行えるということをメモしておきます。 コード #include <iostream> struct Point { int x; int y; }; struct Size { int width; int height; int ar</iostream>…