2
struct Foo{
int _a;
this(int a){ _a = a; }
int opCall(int b){ return b * b; }
}
Foo f;
int rt = f(33); //Error: cannot implicitly convert expression ((Foo __ctmp1294 = 0;
//, __ctmp1294).this(33)) of type Foo to int
TDPL 또는 웹 사이트에서 opCall
에 대한 충분한 정보를 찾을 수 없습니다.opCall을 올바르게 사용하는 방법은 무엇입니까?
this()
과 opCall()
이 모두 필요하지만 this()
이있는 경우 위 코드는 작동하지 않습니다. 생성자를 제거해야합니까?