Udostępnij przez


Ostrzeżenie kompilatora (poziom 3) C4281

"operator ->" rekursja wystąpiła za pomocą typu "type"

Uwagi

Twój kod umożliwia operatorowi> wywoływanie samego siebie.

Example

Poniższy przykład generuje C4281:

// C4281.cpp
// compile with: /W3 /WX
struct A;
struct B;
struct C;

struct A
{
   int z;
   B& operator->();
};

struct B
{
   C& operator->();
};

struct C
{
   A& operator->();
};

void f(A p)
{
   int i = p->z; // C4281
}