私は簡単なプログラムを書きました:
#include<iostream>
#include<list>
using namespace std;
list<int>& func();
int main(){
list<int> a = func();
delete &a;
std::cout<<"Here\n";
}
list<int>& func(){
list<int>* ptr = new list<int>;
return *ptr;
}
このプログラムは決してHere
c ストリームに出力しません....
それは単にクラッシュします..
私は理由を見つけることができません..