#pragma once -> two files are identical if their content is identical
It is that simple.
Two files are considered identical, if their content is identical.
Forget about paths, inodes, whatever other hacks.
Define it like this, it can probably fit in one paragraph of standardize, and be done with it.
After that, compilers are free to do any heuristics and optimizations that help to identify two files as identical, that is perfectly fine.
When the compiler cannot say for sure that two files are the same, it will have to read it, but guess what? If the files are actually different files, it has to read it anyway, to include it in the translation unit.
(btw I am watching the 2 hour video of rants about c++ right now, this issue just strikes me, as i have had enough of conversations about it myself.)
https://redd.it/1p5lg3t
@r_cpp
Post #24337
19