Why can't a Visual C++ interface contain operators?

c++, interface, operator-overloading, visual-c++

Solution

The `__interface` modifier is a Visual C++ extension to help implementing COM interfaces. This allows you to specify a COM 'interface' and enforces the COM interface rules.

And because COM is a C compatible definition, you cannot have operators, Ctor or Dtors.

Problem

As per the MSDN doc on __interface, a Visual C++ interface "Cannot contain constructors, destructors, or operators." Why can't an interface contain an operator? Is there that much of a difference between a get method that returns a reference: ``` SomeType& Get(WORD wIndex); ``` and the overloaded indexer operator? ``` SomeType& operator[](WORD wIndex); ```

Original source

Related problems