
10 Apr
2009
10 Apr
'09
3:45 p.m.
I've seen benchmarks that say some compilers (gcc, msvc) are smart enough to recognize #ifndef/#endif and do the #pragma once equivalent. (i.e. there's no discernable performance difference.)
Nod. Can't comment on msvc but gcc supports the #ifndef...#endif idiom and doesn't reopen the file at all if it's already seen it. That said it wouldn't hurt to extend this to other compilers if we can sort out a definitive list. John.