/
Have a convention to make a unique identifier based on the file name for defensive includes
Have a convention to make a unique identifier based on the file name for defensive includes
This works well for our code base especially since we use name based prefixes to ensure uniqueness of symbols we use for defensive includes across code base:
In our base the convention that makes sense is something like this:
For COLstring.h
Use COL_STRING_H
Basically <prefix>_WORD1_WORD2…_H
The key thing is that if the header file name changes we have to change the defensive include symbol.
, multiple selections available,
Related content
The core idea of a defensive include
The core idea of a defensive include
More like this
Use randomly generated GUIDs for defensive includes
Use randomly generated GUIDs for defensive includes
More like this
Set up a dummy 'library' and unit test
Set up a dummy 'library' and unit test
More like this
Predeclarations instead of #include
Predeclarations instead of #include
More like this
Prefix Namespaces for Separating Concerns
Prefix Namespaces for Separating Concerns
More like this
What problem is created if a header file is included twice?
What problem is created if a header file is included twice?
More like this