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;
...将指不同的对象。