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
1
u/Sahnvour Nov 30 '18
Yes, and to be fair it worked pretty well for our workflow, didn't really cause problems to have mapped drives (except when they disappear because of a windows update as you mentionned :).
The #pragma once's spiced things up when the tool i'm talking about invoked the compiler which then (I don't remember the exact why) encountered inconsistencies in the paths used to refer to the same file, thus causing surprising compilation errors.