Should I avoid STL?

Is it good to use STL?

12 Answers. You should use STL, because it is well tested and optimized. That doesn’t mean you shouldn’t know how to write these data structures yourself. With that ability under your belt, you will be able to choose the best STL data structure for your application.

Is C++ STL bad?

The default STL implementations are designed to give good average case performance across a wide range of use cases but will often give poor results in performance-sensitive applications or in certain well-characterized use cases.

Are STL containers slow?

Folks often will say STL containers are slow in debug, other folks say they aren’t. … “Slow” as a negative statement depends both on what you are doing with them, as well as your need for debug performance.

Is STL library allowed in interviews?

Originally Answered: Is it acceptable to use STL library in coding interview? It is absolutely essential to use STL library as they can be quite a time saver. However, be ready to answer any question that might be asked regarding them.

Why STL is very powerful in advanced functionality in C++ language?

The STL exemplifies generic programming rather than object-oriented programming, and derives its power and flexibility from the use of templates, rather than inheritance and polymorphism. It also avoids new and delete for memory management in favor of allocators for storage allocation and deallocation.

IT IS INTERESTING:  Question: How do I change dimensions in SketchUp Web?

What are some possible drawbacks to the C++ Standard Template Library STL )?

Obvious disadvantages:

  • The syntax can be horrible – some bits of template syntax in C++ are really pushing the limits of sanity, and overlap with other parts of the language (e.g. >>)
  • Lots of people don’t understand the STL very well, so you might restrict your audience.
  • Error messages tend to be hideously complicated.

Which container has faster insertion?

As deque is likely implemented as a vector of fixed-sized arrays, insertion implies a shuffling of all elements towards the nearest end of the container. The shuffling’s probably a tiny bit less cache efficient, but if inserting nearer the front of the container it would likely still end up faster.

What is Flat_map?

A flat_map is a kind of associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of values of another type T based on the keys. The flat_map class supports random-access iterators. … A flat_map also provides most operations described for unique keys.