Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于 C++ 编译器(通常)可以检测到违反ness的情况const,是否有任何工具可以识别错失的将某些东西声明为 的机会const?
const
gcc 有 -Wsuggest-attribute=[pure|const|noreturn|format],但我相信这些仅限于函数和函数指针。
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html