c++ stl

R

ramtin

hi all ,
i want to learn stl c++ programing .
but i actully dont know what stl really is (?)
if any one know a good text book for it plz send it links for me .
and i want to code one of it function in c programing which one do you
think is good for me (to code it) as i am new at this . . .
thanks of all
 
M

MiB

i want to learn stl c++ programing .
but i actully dont know what stl really is (?)

The STL or "Standard Template Library" is a collection of template
classes and functions. For me, it helps most to shift my focus in
application programmers from dealing with low-level implementation
details to addressing the actual problem I need to solve. The STL
covers containers (vectors, lists, sets, associative maps, ...),
character strings, algorithms (sorting, searching, aggregation, ...),
and more. It is part of the C++ standard, so anything you code using
the defined interface of the STL works with any standard complying C++
compiler.
if any one know a good text book for it plz send it links for me .

I would like to recommend you the excellent introduction to the STL by
Stephan T. Lavavej, available as a ten-part video lecture here:
http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Introduction-to-STL-with-Stephan-T-Lavavej
Aside from being a real expert on the STL, Mr. Lavavej is a hard to
find talent at teaching. I personally enjoy watching his lectures a
lot. It is a wonderful contrast to these horrible "dialog-style" shows
(Tom: "We have this really cool thing here, that will make everybody's
life just perfect, what do you think, Bob?" --- Bob: "Yeah, Tom, this
is so great...", over and over, with no actual information conveyed.)

Since he is an Microsoft employee, and Microsoft is sponsoring the
lectures, the presentation is somewhat centered around Visual C++
2010. However, any examples and code shown do not depend on the
Windows operating system or Microsoft IDEs, and should work on Linux /
g++ or other standard compliant compilers without, or minimal change.
Plus, watching the show is free, so I won't complain on some product
placement commercial.
and i want to code one of it function in c programing which one do you
think is good for me (to code it) as i am new at this . . .

I'd recommend to start a project around a problem from *your* personal
life; something where you feel expert at, or have a hobby interest
anyway. Do you collect bottle caps? Go on, create a program that keeps
track of your 10,000+ exhibits and growing collection. Do you do some
team sports? How about a match making or tournament administration
software? Do you work at a pizza restaurant? Make a pizza order by
internet software. You have an old pocket calculator you used at
school? Create a simulation of it. There is plenty of ideas from your
environment, so you don't need to look out for projects thousands of
programmers solved already ad nauseam. I'd find it very hard to come
up with a practical problem where the STL would not be of use.

just my $.02,

MiB.
 
K

K4 Monk

hi all ,
i want to learn stl c++ programing .
but i actully dont know what stl really is (?)
if any one know a good text book for it plz send it links for me .
and i want to code one of it function in c programing which one do you
think is good for me (to code it) as i am new at this . . .
thanks of all

I am a C++ newbie and my understanding is this:

STL = Standard Template Library....the keyword here is "Template".

Basically there are many operations and data structures which are very
common in the programming world and they only way their implementation
differs is through the types of objects they manipulate. So, for
example one implementation could manipulate a queue of "Battleships"
and another implementation could have "Teacups", but at their core,
they are both "queues".

The STL is a project which has factored out the common theme among
many such data structures, so that with a little tweaking you can
create your own data structures and generic containers without
reinventing the wheel.

So for example, instead of doing the following:

class integerLinkedList { };
integerLinkedList l1;

class charLinkedList { };
charLinkedList l2;

you can do:

list<int> l1;
list<char> l2;

and you can have the same universal operations available for both
objects
 
R

Rui Maciel

Leigh said:
Mistake? not at all; the meaning of words and abbreviations can change
over time. These days when somebody says "STL" they often are referring
to the C++ Standard Library rather than the original Standard Template
Library which includes stuff that is not part of currently standardized
C++ Standard Library.

The meaning of "STL" can only "change over time" to be understood as the
C++ standard library if the mistake of confusing the Standard Template
Library with the C++ standard library is reiterated and perpetuated over
time.


Rui Maciel
 
P

Paul

Rui Maciel said:
The meaning of "STL" can only "change over time" to be understood as the
C++ standard library if the mistake of confusing the Standard Template
Library with the C++ standard library is reiterated and perpetuated over
time.
Quite true.
 
J

James Kanze

The C++ standard library encompasses a bit more components
than the STL[1]. If "many people" refer to the C++'s standard
library as "STL" then "many people" are making a mistake.

The C++ standard library is largely a "template" library. And
if a library is "standard", and it is "template", how can
calling it a "standard template library" be a mistake. (One
could argue that calling Stepanov's library a "standard template
library" is misleading advertising, because it certainly wasn't
"standard". At least in the sense that ISO uses "standard".)

The actual meaning of a word depends on common usage, which
means that in this regard, "most people" can never be wrong, In
practice, the usage that I've seen most frequently (but far from
exclusively) would use STL for the parts of Stepanov's library
that were adopted by ISO (but not the other parts), plus
elements of the C++ standard library, like std::basic_string,
which have been STLized. Although the limits are not precise,
this would exclude things like iostream and operator new, but
include basic_string, and perhaps other elements, that weren't
in Stepanov's library. But as I say, the limits are not
precise, and not a few people would include the entire standard
C++ library. If you need to be precise, I'd avoid the term STL.
 
J

James Kanze

The meaning of "STL" can only "change over time" to be understood as the
C++ standard library if the mistake of confusing the Standard Template
Library with the C++ standard library is reiterated and perpetuated over
time.

Which is, or has been, the case. As Leigh says, language
evolves, and today, the exact meaning of STL depends on who is
talking---in other words, the acronym doesn't have an exact
meaning. In many ways, Humpty Dumpty is right. "When I use a
word, it means just what I choose it to mean." Of course, if I
choose something very different from what other people
understand, communication is rendered significantly more
difficult, but in the end, each speaker chooses his or her
vocabulary according to their personal beliefs. And when the
personal beliefs of a majority of a liguistic group change, the
generally accepted meaning changes.
 
J

Jorgen Grahn

The C++ standard library encompasses a bit more components
than the STL[1]. If "many people" refer to the C++'s standard
library as "STL" then "many people" are making a mistake.

The C++ standard library is largely a "template" library.

I think of it as three parts: the C library (which is a quite large
part!), the parts from (or compatible with) the original STL
(containers, iterators and algorithms), and some other stuff
(iostreams, locales, possibly std::string ...).

Personally, when I say STL (which is rarely) I mean the second part.
You'd never hear me claim std::printf is part of the STL.

/Jorgen
 
M

MiB

Congratulations, folks. It took only three posts in this thread (OP,
my answer, and the riposte) to bazooka a beginner's request for
pointers to study material into a completely pointless vivisection of
the three letter acronym STL.

MiB.
 
A

Adrian

hi all ,
i want to learn stl c++ programing .
but i actully dont know what stl really is (?)
if any one know a good text book for it plz send it links for me .
and i want to code one of it function in c programing which one do you
think is good for me (to code it) as i am new at this . . .
thanks of all
A excellent book I've had for many years is

The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis


Adrian
 
R

Rui Maciel

Leigh said:
Shit happens.

Yes, it does. Yet, that doesn't mean that refering to the C++ standard
library as "the STL" makes sense, nor does it justify reiterating a
flagrant error. So, using your expression, shit may happen but that
doesn't give anyone the right to not only intentionally make it but also
spread it around.


Rui Maciel
 
P

Paul

Rui Maciel said:
Yes, it does. Yet, that doesn't mean that refering to the C++ standard
library as "the STL" makes sense, nor does it justify reiterating a
flagrant error. So, using your expression, shit may happen but that
doesn't give anyone the right to not only intentionally make it but also
spread it around.
I think some people don't care if it's correct because it's not important
enough for them to bother. I agree it isn't correct to refer to the std lib
as STL, and I'm sure little things like this are important to people who are
trying to learn and learn things properly.
 
R

Rui Maciel

MiB said:
Congratulations, folks. It took only three posts in this thread (OP,
my answer, and the riposte) to bazooka a beginner's request for
pointers to study material into a completely pointless vivisection of
the three letter acronym STL.

If you believe it's pointless then you failed to understand the problem.
It's impossible to provide any decent pointers on a particular topic if
some people don't know what's the topic. In this case, if people mistake
the STL with the C++ standard library then they can do the newbie a
disservice by suggesting that he reads on C++'s streams or on the C
standard library. If the newbie is in fact looking for the Standard
Template Library stuff, which means the generic containers and all those
algorithms that go with them, then those referring to the complete C++
standard library are effectively wasting his time.


Rui Maciel
 
R

Rui Maciel

Pete said:
Ah yes, citing the infallible wikipedia.

You are free to fix any mistake that the article carries. What mistakes
have you found so far?


Rui Maciel
 
R

Rui Maciel

James said:
Which is, or has been, the case. As Leigh says, language
evolves, and today, the exact meaning of STL depends on who is
talking---in other words, the acronym doesn't have an exact
meaning.

The acronym doesn't have an exact meaning only to those who don't know
what the Standard Template Library is.

In many ways, Humpty Dumpty is right. "When I use a
word, it means just what I choose it to mean." Of course, if I
choose something very different from what other people
understand, communication is rendered significantly more
difficult, but in the end, each speaker chooses his or her
vocabulary according to their personal beliefs. And when the
personal beliefs of a majority of a liguistic group change, the
generally accepted meaning changes.

If we look at this as a semantics issue then the only case that we can
make is that the meaning of an expression can change over time. This is
not the same as claiming that the meaning of an expression should change
over time. In this case, just because some people fail to know the
meaning of STL, either due to confusion or because they simply never
learned what it meant, it doesn't give them the right to perpetuate their
mistakes, particularly those based on ignorance that are subsequently
forced to have some sort of meaning by fooling around with backronym
games. This particular acronym, STL, which refers to C++'s Standard
Template Library, has a very specific and objective meaning. Therefore,
there is absolutely no reason to try to make it some other thing it isn't,
no matter how many people fall for the exact same mistake.


Rui Maciel
 
J

James Kanze

Pete Becker wrote:
MiB is correct, but note that many people use "STL" to refer
to the C++ STandard Library.
The C++ standard library encompasses a bit more components
than the STL[1]. If "many people" refer to the C++'s standard
library as "STL" then "many people" are making a mistake.
The C++ standard library is largely a "template" library.
I think of it as three parts: the C library (which is a quite large
part!), the parts from (or compatible with) the original STL
(containers, iterators and algorithms), and some other stuff
(iostreams, locales, possibly std::string ...).
Personally, when I say STL (which is rarely) I mean the second part.
You'd never hear me claim std::printf is part of the STL.

Good point. The T in STL means template, so STL really
shouldn't refer to anything that isn't a template. For most
people I talk to, STL doesn't include the C library, and it
doesn't include some of the language support either (e.g. the
operator new functions, or the standard exceptions). And for
almost everyone, it does include the parts of Stepanov's library
which were included in the standard. Where the meaning varies
is whether additional templates in the standard library (e.g.
std::basic_string, or the iostreams or the locale stuff) is part
of STL or not, and for some people, whether parts of Stepanov's
library that didn't make it into the standard (like slist), or
templates which have since been added to Stepanov's library
(like rope or hash_map) are part of the STL. Usage varies, so
if you want to be precise, it's best to avoid the term.
 
J

James Kanze

The acronym doesn't have an exact meaning only to those who don't know
what the Standard Template Library is.

The acronym doesn't have an exact meaning for those who wish to
communicate precisely with other people.
If we look at this as a semantics issue then the only case that we can
make is that the meaning of an expression can change over time. This is
not the same as claiming that the meaning of an expression should change
over time.

There's no should in it. There's nobody who is making immutable
laws---even in French, the academie française can't stop the
evolution of language. It's just a fact of life.
In this case, just because some people fail to know the
meaning of STL,

They know their meaning, just as well as you know yours.
either due to confusion or because they simply never
learned what it meant,

They might not have learned what it meant, but they know what it
means. At least in the community they're communicating with.
it doesn't give them the right to perpetuate their
mistakes, particularly those based on ignorance that are subsequently
forced to have some sort of meaning by fooling around with backronym
games.

There's no ignorance or mistake about it. No one is required to
know the full etymology of a word in order to be able to use it.
All they have to know is how the person they're communicating
with will understand it.
This particular acronym, STL, which refers to C++'s Standard
Template Library, has a very specific and objective meaning.

Which has changed over time. When I first heard it, it meant a
library developed and maintained by Stepanov, including some
things that aren't in the standard C++ library today. You're
meaning doesn't correspond to the original use. (And wha do you
mean by C++'s Standard Template Library? C++ has a standard
library, much of which is implemented using templates, but
there's no such thing as C++'s standard template library.)
Therefore, there is absolutely no reason to try to make it
some other thing it isn't, no matter how many people fall for
the exact same mistake.

It's not a mistake for people to use a common vocabulary, as
long as they understand one another.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top