Microsoft-STL 和 GNU-STL 之间的差异

问题描述

如您所知,您不能用 C++ 编写这样的代码

struct Test
{
    Test _this;
};

但这很有可能

struct Test
{
    Test* _this;
};

那时我在编写以下代码时遇到此错误

error: 'std::pair<_T1,_T2>::second' has incomplete type
       _T2 second
struct Test
{
    std::unordered_map<int,Test> dictionary;
};

我认为 std::pair 的 msvc 实现使用指针进行存储。

这是真的吗?如果不是,实现之间的区别是什么?这是什么原因?

https://godbolt.org/z/vafxjW5vd

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)