none
Indexed property Problem in C++/CX RRS feed

  • Question

  • Hi, I am working on an APP by using C++/CX these days. And I have to declare an indexed property for data bounding, however, here comes a very strange problem.

    public ref class A sealed
    {
    public:
      property int default[int]
      {
        int get(int index);
      }  
      ...
    private:
      ...
    }

    The problem is: "Indexed property with a public 'get' or 'set' accessor is not allowed."

    But in C# there is no such limit. If it must be private o protected in C++/CX, then what should I do to create a data bounding to the property. Thanks.^_^ 

    Monday, September 1, 2014 8:48 AM