const-correctness
Can a heap-allocated object be const in C++?
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:[详细]
2022-12-14 13:46 分类:问答Is "const LPVOID" equivalent to "void * const"?
And if so, why some Win32 headers use it? For instance: BOOL APIENTRY VerQueryValueA( const LPVOID pBlock,[详细]
2022-12-13 03:43 分类:问答Is this code legal in C++
I just found that when it comes to templates this code compiles in g++ 3.4.2 and works unless m() is not called:[详细]
2022-12-12 20:32 分类:问答Const correctness for value parameters
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[详细]
2022-12-11 11:22 分类:问答