Stl
The Standard Template Library (STL) is a software library partially included in the C++ Standard Library. It provides containers, iterators, algorithms, and functors. More specifically, the C++ Standard Library is based on the STL published by SGI. Both include some features not found in the other. SGI's STL is rigidly specified as a set of headers, while ISO C++ does not specify header content, and allows implementation either in the headers, or in a true library.// OverviewThis article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (September 2007)The STL provides a ready-made set of common classes for C++, such as containers and associative arrays, that can be used with any built-in type and with any user-defined type that supports some elementary operations (such as copying and assignment). STL algorithms are independent of containers, which significantly reduces the complexity of the library.The STL achieves its results through the use of templates. This approach provides compile-time polymorphism that is often more efficient than traditional run-time polymorphism. Modern C++ compilers are tuned to minimize any abstraction penalty arising from heavy use of the STL.The STL was created as the first library of generic algorithms and data structures for C++, with four ideas in mind: generic programming, abstractness without loss of efficiency, the Von Neumann computation model, and value semantics. Contents ContainersThe STL contains sequence containers and associative containers. The standard sequence containers include vector, deque and list. The standard associative containers are set, multiset, map and multimap.ContainerDescriptionSequences (Arrays / Linked Lists) - ordered collectionsvectora dynamic array, like C array (i.e., capable of random access) with the ability to automatically resize itself when inserting or erasing an object. Inserting and removing an element to/from back of the vector at the end takes amortized constant time. Inserting and erasing at the beginning or in the middle is linear in time.A specialization for type bool exists, which optimizes for space by storing bool values as bits.lista doubly-linked list; elements are not stored in contiguous memory. Opposite performance from a vector. Slow lookup and access (linear time), but once a position has been found, quick insertion and deletion (constant time).deque (double ended queue)a vector with insertion/erase at the beginning or end in amortized constant time, however lacking some guarantees on iterator validity after altering the deque.Associative containers - unordered collectionsseta sorted set; inserting/erasing elements in a set does not invalidate iterators pointing in the set. Provides set operations union, intersection, difference, symmetric difference and test of inclusion. Type of data must implement comparison operator < or custom comparator function must be specified. Implemented using a self-balancing binary search tree.multisetsame as a set, but allows duplicate elements.mapa sorted associative array; allows mapping from one data item (a key) to another (a value). Type of key must implement comparison operator < or custom comparator function must be specified. Implemented using a self-balancing binary search tree.multimapsame as a map, but allows duplicate keys.hash_sethash_multisethash_maphash_multimapsimilar to a set, multiset, map, or multimap, respectively, but implemented using a hash table; keys are not sorted, but a hash function must exist for key type. These containers are not part of the C++ Standard Library, but are included in SGI's STL extensions, and are included in common libraries such as the GNU C++ Library in the __gnu_cxx namespace. These are scheduled to be added to the C++ standard as part of TR1, with the slightly different names of unordered_set, unordered_multiset, unordered_map and unordered_multimap.Other types of containersbitsetstores series of bits similar to a fixed-sized vector of bools. Implements bitwise operations and lacks iterators. Not a Sequence.valarrayanother C-like array like vector, but is designed for high speed numerics at the expense of some programming ease and general purpose use. It has many features that make it ideally suited for use with vector processors in traditional vector supercomputers and SIMD units in consumer-level scalar processors, and also ease vector mathematics programming even in scalar computers. IteratorsThe STL implements five different types of iterators. These are input iterators (which can only be used to read a sequence of values), output iterators (which can only be used to write a sequence of values), forward iterators (which can be read, written to, and move forward), bidirectional iterators (which are like forward iterators but can also move backwards) and random access iterators (which can move freely any number of steps in one operation).It is possible to have bidirectional iterators act like random access iterators, as moving forward ten steps could be done by simply moving forward a step at a time a total of ten times. However, having distinct random access iterators offers efficiency advantages. For example, a vector would have a random access iterator, but a list only a bidirectional iterator.Iterators are the major feature which allow the generality of the STL. For example, an algorithm to reverse a sequence can be implemented using bidirectional iterators, and then the same implementation can be used on lists, vectors and deques. User-created containers only have to provide an iterator which implements one of the 5 standard iterator interfaces, and all the algorithms provided in the STL can be used on the container.This generality also comes at a price at times. For example, performing a search on an associative container such as a map or set can be much slower using iterators than by calling member functions offered by the container itself. This is because an associative container's methods can take advantage of knowledge of the internal structure, which is opaque to algorithms using iterators. AlgorithmsA large number of algorithms to perform operations such as searching and sorting are provided in the STL, each implemented to require a certain level of iterator (and therefore will work on any container which provides an interface by iterators). FunctorsThe STL includes classes that overload the function operator (operator()). Classes that do this are called functors or function objects. They are useful for keeping and retrieving state information in functions passed into other functions. Regular function pointers can also be used as functors.A particularly common type of functor is the predicate. For example, algorithms like find_if take a unary predicate that operates on the elements of a sequence. Algorithms like sort, partial_sort, nth_element and all sorted containers use a binary predicate which must provide a strict weak ordering, that is, it must behave like a membership test on a transitive, irreflexive and antisymmetric binary relation. If none is supplied, these algorithms and containers use less by default, which in turn calls the less-than-operator <. Criticisms Quality of compilerThe Quality of Implementation (QoI) of the C++ compiler has a large impact on usability of STL (and templated code in general):Error messages involving templates tend to be very long and difficult to decipher. This problem has been considered so severe that a number of tools have been written which simplify and indent STL-related error messages to make them more comprehensible. A proposal to the new C++ Standard (concept checking) tries to reduce this problem. For now, you can use special tool and techniques to cleanup your error messages, see Error formatting.Careless use of STL templates can lead to code bloat. This has been countered with special techniques within STL implementation (using void* containers internally) and by improving optimization techniques used by compilers.Template instantiation tends to increase compilation time and memory usage (even by an order of magnitude). Until the compiler technology improves enough this problem can be only partially eliminated by very careful coding and avoiding certain idioms. STL design issuesInitialization of STL containers with constants within the source code is not as easy as data structures inherited from C (addressed in C++0x with initializer lists).STL containers are not intended to be used as base classes (their destructors are deliberately non-virtual). Deriving from a container is a common mistake made by novices.The concept of iterators as implemented by STL can be difficult to understand at first: for example, if a value pointed to by the iterator is deleted, the iterator itself is then no longer valid. This is a common source of errors. Most implementations of the STL provide a debug mode which is slower but can locate such errors if used. However, at present no better replacement for iterators has been suggested and a similar problem exists in other languages, for example Java.Certain iteration patterns do not map to the STL iterator model. For example, callback enumeration APIs cannot be made to fit the STL model without the use of coroutines, which are platform-dependent and/or unavailable, and are outside the C++ standard.Compiler compliance does not guarantee that allocator objects, used for memory management for containers, will work with state dependent behavior. For example, a portable library can't define an allocator type that will pull memory from different pools using different allocator objects of that type. (Meyers, p. 50)The set of algorithms is not complete — for example, the copy_if algorithm was left out by oversight (Stroustrup, p. 530) (added in C++0x: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf).The interface of some
Louis • Three people were injured by an explosion and fire at a house in the 4200 block of College Avenue Friday night. As a free .Sun, Sep 14CHI @ CAR TEN @ CIN GB @ DET BUF @ JAC OAK @ KC IND @ MIN NYG @ STL NYG @ STL NO @ WAS NO @ WAS SF @ SEA ATL @ TB MIA @ ARI SD @ DEN NE @ NYJ PIT @ CLE PHI @ DAL You can use this site to Watch NFL football Games Online.Hope it can help you. Check the Shop’n Save ad in today’s paper for weekly savings. Getting soÂmÂe PriÂntaÂble GeÂrbeÂr BaÂby CouÂpons cÂan solve tÂhiÂs prÂobleÂmÂ. Adam Relson Jala of the third district to introduce the Small Town Lottery or STL in Bohol. Adam Jala (3rd dist), vice chairman of the House committee on government enterprises, is spearheading the campaign for the entry of STL in Bohol.. TherefoÂre, it bÂecoÂmÂes a bÂit coÂstlÂy foÂr the parents having tight bÂuÂdÂget.Sun, Sep 14CHI @ CAR TEN @ CIN GB @ DET BUF @ JAC OAK @ KC IND @ MIN NYG
Even more about Stl
Stl
A freely available implementation of the C++ Standard Template Library, including hypertext documentation.
Read more...
Standard Template Library Programmer's Guide
STL is a file format native to the stereolithography CAD software created by 3D Systems. This file format is supported by many other software packages; it is widely used for rapid ...
Read more...
STL (file format) - Wikipedia, the free encyclopedia
Angers Everywhere : Growing Up Is A Giant Challenge Juniors Giants Retail: $14.95 Junior Anderson is a smart elementary school student with wit, imagination and a comically ...
Read more...
STL Distribution | Advancing the Christian Faith.
From The Desk Of Tim McKernan. The 2009 Cardinal Offseason: Isringhausen Coming Back...And ... STL Missouri Tigers
Read more...
insideSTL
St. Louis sports, news, events, tickets, business, entertainment, jobs, autos and real estate listings from the St. Louis Post Dispatch & STLtoday.com.
Read more...