▲ | motorest 4 days ago | |
> I don't understand what you're saying here. #pragma once does the job that include guards used to do, (...) They don't. They are not C++ and at most they are compiler-specific. It's fine if you opt to not write C++ and instead target specific compilers instead. Just don't pretend it's not frowned upon or kosher. | ||
▲ | bogwog 4 days ago | parent | next [-] | |
TIL about the existence of a passionate #pragma once hating subculture. Since you seem to be more knowledgeble about this, I'm curious to know which C++ compilers lack support? I know that at least the 3 big ones do (GCC, Clang, and MSVC) and they have for a very long time. | ||
▲ | jcelerier 4 days ago | parent | prev [-] | |
it's absolutely not frowned upon in 2025. All the compilers that matter (GCC, Clang and MSVC) support and have supported them for two decades. Major projects use #pragma once internally - I see files using it in Qt, LLVM, etc. |