Compiler Warning (level 4) C5266
'const' qualifier on return type has no effect
The C++ Standard specifies that a top-level const (or volatile) qualification on a function return type is ignored.
This warning is off by default.
This warning was introduced in Visual Studio 17.6
Example
The following sample generates C5266:
// compile with: /W4 /c
#pragma warning(default : 5266) // enable warning C5266 because it's off by default (or compile with /w45266)
const int f() // warning C5266: 'const' qualifier on return type has no effect
{
return 13;
}
See also
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ