Compiler Error C2274
'type' : illegal as right side of '.' operator
A type appears as the right operand of a member-access (.) operator.
This error can be caused by trying to access a user-defined type conversion. Use the keyword operator
between the period and type
.
The following sample generates C2286:
// C2274.cpp
struct MyClass {
operator int() {
return 0;
}
};
int main() {
MyClass ClassName;
int i = ClassName.int(); // C2274
int j = ClassName.operator int(); // OK
}
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre