In C++ a stack-allocated object can be declared const: const Class object; after that trying to call a non-const method on such object is undefined behaviour:
And if so, why some Win32 headers use it? For instance: BOOL APIENTRY VerQueryValueA( const LPVOID pBlock,
I just found that when it comes to templates this code compiles in g++ 3.4.2 and works unless m() is not called:
I know t开发者_StackOverflowhere are few question about const correctness where it is stated that the declaration of a function and its definition do not need to agree for value parameters. This is be