注意使用 头文件保护符(header guard): 在设计头文件时,应使其可以多次包含在同一源文件中,我们必须保证多次包含同一头文件不会引起该头文件定义的类和对象被多次定...
基于62个网页-相关网页
使得头文件安全的通用做法,是使用预处理器定义头文件保护符。
A common way to make headers safe USES the preprocessor to define a header guard.
头文件保护符用于避免在已经见到头文件的情况下重新处理该头文件的内容。
The guard is used to avoid reprocessing the contents of a header file if the header has already been seen.
头文件应该含有保护符,即使这些头文件不会被其他头文件包含。
Headers should have guards, even if they aren't included by another header.
应用推荐