Tag: const-correctness
3 posts
-
"passing const as this discards qualifiers": Ten C++ const Errors and Their Fixes
Ten real GCC const errors, from "discards qualifiers" to "cannot bind non-const lvalue reference": what each message means and the fix, not const_cast.
-
C++ Clean Code Basics: Express Intent with const and noexcept
Use const correctness, noexcept, and [[nodiscard]] in C++ APIs so interfaces state what they guarantee.
-
Const Correctness in C++: const Members, Pointers, References and When mutable Is Fine
C++ const correctness: reading const pointers, const member functions and GCC errors, shallow const, thread-safe mutable, and const that blocks moves.