gpt4 book ai didi

c# - 结构的不变性

转载 作者:IT王子 更新时间:2023-10-29 04:10:06 28 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Why are mutable structs evil?

我在包括此处在内的很多地方都读到过,最好将结构设置为不可变。

这背后的原因是什么?我看到许多 Microsoft 创建的可变结构,例如 xna 中的结构。 BCL 中可能还有更多。

不遵循此指南的利弊是什么?

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com