Блог пользователя DessertKid

Автор DessertKid, история, 7 лет назад, По-английски

I've seen many people writing many header files explicitly and not using bits/stdc++.h. Does using bits/stdc++.h have any disadvantages?

  • Проголосовать: нравится
  • +50
  • Проголосовать: не нравится

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится +56 Проголосовать: не нравится

It works in GCC only and there are probably no guarantees that it will still work in the future. It also slows down compilation as compiler has to process much more files (unless you use it as intended — as a precompiled header, see below). There are several other downsides, they all sum up to "it's unacceptable in production code".

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

That people, as I think, use XCode (IDE) on MacOS. It IDE hasnt <bits/stdc++.h> header. P.S. it just my hypothesis and sorry for my ENG.

»
7 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

People who code in visual studio don't use it because it doesn't work there. Other reasons:

  1. It slows down compilation time(doesn't affect execution time though)

  2. On few OJs, Variable name y1 doesn't work with it. Example How to avoid it

»
4 года назад, # |
  Проголосовать: нравится -11 Проголосовать: не нравится

It's hard to memorize?

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

A Noob like me sometimes write #include<bits\stdc++.h> And then it's hard to debug the error...

Ps: I don't do this now.. but it happened to me once.