-
Notifications
You must be signed in to change notification settings - Fork 98
Header guards #377
Comments
Thank you for looking into this as well. I'm thinking we could just force |
I created header guards because I have some project with stupid guidelines that I didn't want to break. In case of my project you are right. Good habits and simplicity should be promoted, and nothing bad gonna happen if some unrelevant guidelines will be broken. |
The only cases I can think of is when using really old compilers, or if one header file is split into several in a weird build setup. But I think it's safe to just add |
Good thinking. Thank you. |
I implemented my proposal in the commit above. I'm thinking it is better to have it than not:) |
In general, there is small chance anyone would want to create header file without header guards or pragma once, so why not generate it anytime new .h or .hpp file is created?
I did something like that on my fork:
szymonk211@cecd283
because I needed it for some project that uses header guards.
My solution might be a bit incomplete though. In this solution header stubs are generated according to the global policy. Header policy from current project is not taken into account. There is a risk that user can by accident mix header guards with pragmas because of that. If user had two projects: one with pragmas and one with guards, he would have to change the global settings any time he starts working on another project.
This is partially related to #294.
The text was updated successfully, but these errors were encountered: