About STL

STL is supplied c ++ Standard Template Library, commonly encapsulated therein generic algorithms, data structures. Is reusable component library. STL has six components, namely, container, algorithms, iterators, adapter, functor space configurator.

1. containers: such as arrays, various tables, trees, data structures, etc. FIG. A template-package.

Algorithm 2: the data structure associated with a particular algorithm, the general type of algorithm.

3. iterators: allow transparent data structure, data were not concerned about what data structure.

4. Adapter: stacks and queues.

5. functor: objects can be used as a function to make the algorithm more flexible.

6. Space Configuration: Responsible for the application and free up space, and space management.

C ++ 98 of STL:

 

 

STL defects  :
Update 1. STL library too slow. This was severely Tucao, the previous version of the fly is C ++ 98, the middle of some of the basic C ++ 03 amendments. C ++ 11 has been separated out for 13 years, STL was further updates.

2. STL now without the support thread safety. We need to lock yourself concurrent environment. And the lock granularity is relatively large.

3. STL extreme pursuit of efficiency, resulting in internal complex. Such as the type of extraction, extraction iterators.

4. STL will use code bloat problems, such as using vector / vector / vector which will generate multiple copies of the code, of course, is caused by the template syntax itself.

 

 

Guess you like

Origin www.cnblogs.com/fengkun/p/11909227.html