const
is a compile-time feature.
It doesn’t prevent you from shooting yourself in the foot; that’s what the warning is for.
More Related Contents:
- What is the difference between const int*, const int * const, and int const *?
- Why isn’t it legal to convert “pointer to pointer to non-const” to a “pointer to pointer to const”
- Does const-correctness give the compiler more room for optimization?
- C++ typedef interpretation of const pointers
- Modifying a const int in C++ [duplicate]
- Pointer to array with const qualifier in C & C++
- C++: Why is const_cast evil?
- Returning non-const reference from a const member function
- Use const wherever possible in C++?
- non-const pointer argument to a const double pointer parameter
- Avoid memory leaks in C++ Pointers [closed]
- Difference between list<Observer*>* and list<Observer*> in C++ [closed]
- When were pointers added to C / C++? [closed]
- Odd error: ‘FILE *’ differs in levels of indirection from ‘FILE’ [closed]
- Is it a good idea to typedef pointers?
- What is the type of string literals in C and C++?
- Function does not change passed pointer C++
- Why use pointers? [closed]
- C++: const reference, before vs after type-specifier
- How many and which are the uses of “const” in C++?
- Conversion of pointer-to-pointer between derived and base classes?
- What is the default constructor for C++ pointer?
- Difference between pointer to a reference and reference to a pointer
- What is the use of intptr_t?
- Is Pointer-to- ” inner struct” member forbidden?
- Why can’t I do polymorphism with normal variables?
- Isn’t the const modifier here unnecessary? [duplicate]
- Static global variables in C++
- Where ampersand “&” can be put when passing argument by reference?
- Polymorphism & Pointers to arrays [duplicate]