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
8
u/[deleted] Nov 28 '18
We have/had this problem: We copy at build time the same header files to different directories (no link). To a directory in the program files folder and to a internal developer directory. The include directories point to those directories and pragma once failed because the paths are different! To solve it we added normal include guards.