Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が行った場合:
myclass a = new myclass(); myclass b = a;
bはを指していますか、それともコピーですかa?
b
a
D のクラスは参照セマンティクスを使用するためb、 と同じオブジェクトを指しますa。一方、構造体は値のセマンティクスを使用するため...
auto a = mystruct(); auto b = a;
...個別のオブジェクトを参照します。