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
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor