หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
user-defined conversion 'type' takes no formal parameters
User-defined type conversions cannot take formal parameters.
The following sample generates C2835:
// C2835.cpp
class A {
public:
char v_char;
A() {
v_char = 'A';
}
operator char(char a) { // C2835
// try the following line instead
// operator char() {
return v_char + 1;
}
};
int main() {
A a;
}