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.
有可能吗?它不能开箱即用,因为它会在对象未序列化时尝试复制对象
更新 1:这些对象是不可复制的,因为它们分配内存,一旦分配,我看不出有任何理由在可以移动它时进行复制。反序列化部分应尽可能快。
前段时间我遇到过类似的问题,而 IIRC 我没有找到任何解决方案,所以我反序列化了另一种类型的对象并将其输入到实际对象的构造函数中。另一种类型的设计只是为了快速反序列化并将其内容移动到实际对象。