6
나는 C++/CLI 클래스가 있습니다액세스 C++/CLI 오버로드 [] C#에서 운영자
public ref class Foobar
{
public:
// methods here etc..
// operator overload
double operator[](int index);
}
어떻게 내가 해봤 주어진 C 번호에서 Foobar
에 액세스 할을 :
Foobar foo = new Foobar();
int i = foo[1];
및 나는 CS0021: Cannot apply indexing with [] to an expression of type 'Foobar'
* 기본 인덱서 *에 대해 이야기하고 있습니다. * 인덱스 된 속성 *의 특별한 경우입니다. –