![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0
![]() |
Difference : STL and Standard library
What is the difference between C++'s Standard Library and Standard Template Library?
|
|
|
|
|
|
#2 |
|
Professional Programmer
|
The Standard Template Library makes up a large part of the Standard Library.
|
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
The biggest difference is that the STL uses templates (hence the T) to provide some more advanced data structures. These data structures are type-agnostic, a benefit derived from templates.
__________________
"Time is an illusion. Lunchtime doubly so." -the late, great Douglas Adams |
|
|
|
|
|
#4 | ||
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5
![]() |
Quote:
And there is much more to the STL than data structures. Quote:
For example, there are various conditions that a type, X, must satisfy before a std::vector<X> can be declared and used. One of those conditions is that X must be copyable (eg it is a basic type, or a class with a valid copy constructor and assignment operator). Similarly, there are certain conditions that must be met for algorithms in the STL to work. For example, the std::sort() algorithm requires that the type it works with can be compared by value (to determine if x1 < x2 or not). |
||
|
|
|
|
|
#5 | |||
|
Hobbyist Programmer
|
Quote:
![]() Quote:
Quote:
Once again, the biggest point of difference here is the generic nature of the STL-provided algorithms, data structures and constructs.
__________________
"Time is an illusion. Lunchtime doubly so." -the late, great Douglas Adams |
|||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|