-3

I have read many places that bits/stdc++.h contains all the header files that are useful in competitive programming, for saving time. Can anyone give me any source for it or give the list in the of its header files?

Abhishek Patil
  • 502
  • 1
  • 4
  • 12
  • 3
    *I am curious to know the list of that header files* -- Why repeat this bad habit of using that header? Many questioners have been burned by including that non-standard header, and things either do not compile, or compile and break due to clashes with other headers. – PaulMcKenzie Oct 10 '19 at 13:04
  • 3
    It's implementation defined. It might not even exist. Don't use it. – Ted Lyngmo Oct 10 '19 at 13:04
  • 4
    In addition to the previous comments, if your compiler happens to have it, all it is going to do is needlessly increase the compile time, and teach you bad habits. Include only what you need, and know what you are including. – ChrisMM Oct 10 '19 at 13:07
  • 6
    Why not just look? – stark Oct 10 '19 at 13:08
  • Possible duplicate of https://stackoverflow.com/questions/25311011/how-does-include-bits-stdc-h-work-in-c – HolyBlackCat Oct 10 '19 at 13:09
  • 4
    @TedLyngmo -- formally, it's not implementation-defined. In the standard, "implementation defined" means that a conforming implementation must document its behavior. – Pete Becker Oct 10 '19 at 13:09
  • @PeteBecker Unfortunate wording on my part. "_What it includes is defined by the implementation_" to not clash with the formal meaning would probably have been better. – Ted Lyngmo Oct 10 '19 at 13:12
  • 1
    Possible duplicate of [Why should I not #include ?](https://stackoverflow.com/questions/31816095/why-should-i-not-include-bits-stdc-h) – Aconcagua Oct 10 '19 at 13:14
  • @TedLyngmo: No, because that would still require its existence, and additionally that the documentation contains a (possibly empty) list of its contents. – MSalters Oct 10 '19 at 13:15
  • @MSalters I have "_It might not even exist_" right after that sentence though. – Ted Lyngmo Oct 10 '19 at 13:15
  • "saving the[sic] time". Why do you think it saves time to include many, many files which you don't need? The compiler has to compile every line of code in your program, whether you wrote it yourself or whether it was brought in by inclusion. You may have included literally a million lines of code, most of which are not going to be necessary. – MSalters Oct 10 '19 at 13:18
  • I was not asking that one should use it or not. I was asking for the list of header files it contains. so it is not duplicate of https://stackoverflow.com/questions/25311011/how-does-include-bits-stdc-h-work-in-c or https://stackoverflow.com/questions/31816095/why-should-i-not-include-bits-stdc-h . Thanks for your supports. I will consider your suggestion of not using it while coding. – Abhishek Patil Oct 10 '19 at 13:22
  • @AbhishekPatil *I was not asking that one should use it or not.* -- The comment section is for comments, not answers. You were receiving justified comments on the caveats of using such a header. – PaulMcKenzie Oct 10 '19 at 14:23
  • @TedLyngmo -- Re: "Unfortunate wording" -- yes. It's quite common, which is why I make a point of calling it out. – Pete Becker Oct 10 '19 at 14:24
  • @PeteBecker Good! I wasn't aware that "implementation defined" had such requirements, but now I do. Thanks. – Ted Lyngmo Oct 10 '19 at 14:36

1 Answers1

4

You can open the file in the path where your all the c++ header files are kept. (Locate the file stdc++.h).

Or you can get one of the versions of the file in the link described here: stdc++.h