C++ can't really do that at the language level. Even some of the suggestions in the comments, like checking to see whether a property of an iostream header already exists, wouldn't work. The reason being that headers are not isolated; nothing is stopping a .cpp file from including an iostream header followed by your own header. Checking a property in a header would give a false positive, since it wasn't the header that included it.
Your question is about a general dependency graph, which is not a thing C++ as a language recognizes (at least, not as far as headers are concerned). And if you had C++20's modules... well, you wouldn't care, because module importation doesn't cause the problem you're trying to avoid.
So any attempt to verify what you're trying to test would ultimately be based on something in the build system, not the language. The most you could do is get a dump of which headers include which other headers, and run that through some pattern matching to look for iostream headers.