下面是导致VS2013 express版崩溃的程序。同样的程序在gcc4.8上编译并成功运行。在我看来,这是VS的bug。
#include<iostream>
#include<string>
struct x
{
public:
std::string s{};
//Does not crash if we replace above line with below one
//std::string s{"VS2013"};
int i{10};
public:
x() = default;
~x() = default;
x(const x& rhs) = default;
x& operator=(const x& rhs) = default;
};
int main()
{
x a;
std::cout << a.s << std::endl;
std::cout << a.i << std::endl;
return 0;
}
我想知道我的假设是正确的还是我遗漏了什么
安装vs2013的最新服务包。它会消失的