Giant_on_weed's blog

By Giant_on_weed, history, 2 years ago, In English

I am just curious if there will be a problem if I don't if I keep PBDS code uncommented in my template. Can it cause slow execution time or something like that? Also, in case if anyone knows, why isn't ordered set already included in C++ STL library, it there some problems it can cause in real world applications?

  • Vote: I like it
  • +14
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't use it at all because I've seen it being the reason for solutions not passing due to it being somewhat slow.

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think it's just because some people don't like to include something they don't use in their code.

»
2 years ago, # |
  Vote: I like it +5 Vote: I do not like it

No including PBDS in your code does not slows execution time but it will increase compilation time. Ordered Set is not included in C++ STL because it is not a part of C++ STL , it's a part of GNU based Policy based data structures and is present in GCC only.

The reasons I can think of why most people comment PBDS code in their template are

  • It increases compilation time.
  • On some versions of MinGW the name of file is very weird something like hash_standard_resize_policy_imp.hpp0000644 and on including #include<ext/pb_ds/assoc_container.hpp> in their code throws the error Error was "cannot open source file hash_standard_resize_policy_imp.hpp ". so they don't bother with it and simply comment it out.