-2
오늘 나는 D를 평가하면서 언어를 조금 실험했으며 즉시 세그 폴트를 실행했습니다.템플릿 기반 클래스를 사용할 때 Segfault
import std.stdio;
import std.typecons;
class Foo(T){
public:
T i;
}
class Bar{
public:
int hello = 0;
}
void main()
{
Foo!(Bar) f;
int i = f.i.hello;
}
왜이 코드가 segfault입니까?
이것이 왜 downvoted되었는지 전혀 모르겠다. 그것은 매우 유효한 질문이다. –