#include header guard format?

后端 未结 13 1656
广开言路
广开言路 2020-12-05 07:46

I know it makes little difference to a project but, assuming you use #defined header guards for your C++ code, what format do you use? e.g. assuming a header called f

13条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 08:14

    Personally, i just use the filename FOO_HPP. Google uses the whole path like SRC_ENGINE_FAST_HPP.

    Certain sets of names and function signatures are always reserved to the implementation:

    • Each name that contains a double underscore (_ _) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implementation for any use.
    • Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.

    (17.4.3.1.2/1)

提交回复
热议问题