3 ms·
This. For decades, Bloomberg development, and people so unfortunate as to follow them (because of silly book from the early '90s) adhered to an idiotic convent
by ncmncm 5y ago
This.
For decades, Bloomberg development, and people so unfortunate as to follow them (because of silly book from the early '90s) adhered to an idiotic convention that wrapped every #include directive in an #ifdef block. Of course, all compilers, also for decades, recognized when they had already seen an include file that itself was wrapped in its own #ifdef block, and skipped it. Later this same behavior was simplified to #pragma once, obviating the need to invent unique preprocessor names for all headers, which on occasion collided or were misspelled, with amusing results.
There are no remaining C++ compilers in use, outside of sad pre-Standard backwaters, that do not implement #pragma once.
And anyway, the proper solution if you are worried about compilation time is to switch to C++20 modules.