gpt4 book ai didi

c++ - 为什么 std::string 与 C union 不兼容?

转载 作者:太空狗 更新时间:2023-10-29 20:00:31 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Why compiler doesn't allow std::string inside union ?

当我开始使用 C++ 时,我知道我遇到了这个问题:编译器不允许我将 std::string 类型的变量放入 union 中。

那是几年前的事了,但实际上我仍然不知道确切的答案。我读了一些与复制函数相关的内容,其中包含 union 不喜欢的字符串,但仅此而已。

  • 为什么 C++ STL 字符串与 union 不兼容?

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