Cosmos: Stop Using <bits/stdc++.h> for Portability

Created on 18 Oct 2017  路  2Comments  路  Source: OpenGenus/cosmos

This is a(n):

  • [ ] New algorithm
  • [ ] Update to an existing algorithm
  • [x] Error
  • [x] Proposal to the Repository

Details:

I was googling up about the header file <bits/stdc++.h>, and found that it is considered generally bad practice to use it, because it is nonportable (It only works on g++, not MSVC or XCode), and it increases compilation time and runtime (linking all the implementations) (since it is including everything in the standard library).

  1. (Source)
  2. (Source)

Thus, I vote not using this header file and instead directly including files from the standard.

Most helpful comment

@arnavb yes its a bad practice coz it binds all header files and std library

All 2 comments

@arnavb yes its a bad practice coz it binds all header files and std library

I will open a PR soon that will attempt to solve this. Also, I think we should mandate any new PRs to NOT use the header file, but to directly include the STL files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qoo2p5 picture qoo2p5  路  4Comments

arnavb picture arnavb  路  3Comments

rhendz picture rhendz  路  4Comments

InfiniteCoder picture InfiniteCoder  路  3Comments

arnavb picture arnavb  路  3Comments