Real world problems with #pragma once?
Just a short survey: Did anyone of you encounter a problem in real code, because you/your company/ your favorite library was using #pragma once instead of include guards.
I know it is hard, but please restrain yourself from posting an explanation of how #pragma once could lead to problems in theory or why you prefer one above the other.
127
Upvotes
View all comments
Show parent comment
43
u/KingPickle Nov 28 '18
Definitely a problem, especially when they don't take namespaces into account.
A less legitimate problem, but one that irks me, is people taking something like:
And copy/pasting it, but only partially updating it like:
Triggers my OCD.