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

Автор Giant_on_weed, история, 3 года назад, По-английски

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?

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

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

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.

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

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

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

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.