|
|
|
|
|
by motorest
336 days ago
|
|
> What major compiler does not support it? The whole point is that it's not supported and it's not standard, thus using #pragma once needlessly introduced the risk of having the code break. You should ask yourself what are you doing and why are you using non-standard constructs that may or may not work, specially when it's rather obvious and trivial to just use include guards. Using #pragma once isn't even qualify as being clever to gain anything. |
|
If the standards still don't have a proper replacement for include guards, then too bad for the standards. The C++ standard wasn't aware of multithreading before C++11, this didn't stop people from writing multithreaded programs.
As to why - #pragma once is just cleaner to look at.