3 ms·
The compiler needs to see it to know how to call it.
by saagarjha 3y ago
The compiler needs to see it to know how to call it.
- reactordev 3y agoIn which case, it needs to keep parsing the include tree until it finds it. I know why it exists. I’m just not happy about duplicating code. Other compilers are smarter than this.
- duskwuff 3y agoIf you're using a modern IDE, clangd can be configured to automatically insert #include statements (--header-insertion=iwyu).
- saagarjha 3y agoThe thing I hate about this is that it really has no idea what a “public” header is. If I have it on I’ll use something like uintptr_t and get a random include for <__bits/std/uintptr.h> or something that I don’t want. I assume there’s like some manual auditing one can do to go “don’t peek through stdint.h” but either nobody does this reliably or it doesn’t work.