Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   c++ stl (http://www.velocityreviews.com/forums/t743783-c-stl.html)

ramtin 02-18-2011 07:22 AM

c++ stl
 
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

MiB 02-18-2011 09:12 AM

Re: c++ stl
 
On Feb 18, 8:22*am, ramtin <tom.t.2...@gmail.com> wrote:
> 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...phan-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.

K4 Monk 02-18-2011 02:42 PM

Re: c++ stl
 
On Feb 18, 12:22*pm, ramtin <tom.t.2...@gmail.com> wrote:
> 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

Rui Maciel 02-18-2011 09:52 PM

Re: c++ stl
 
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.


Rui Maciel

[1] http://en.wikipedia.org/wiki/C%2B%2B_Standard_Library

Rui Maciel 02-18-2011 10:34 PM

Re: c++ stl
 
Leigh Johnston wrote:

> 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

Paul 02-18-2011 10:49 PM

Re: c++ stl
 

"Rui Maciel" <rui.maciel@gmail.com> wrote in message
news:4d5ef3fa$0$24801$a729d347@news.telepac.pt...
> Leigh Johnston wrote:
>
>> 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.
>
>

Quite true.


James Kanze 02-18-2011 11:26 PM

Re: c++ stl
 
On Feb 18, 9:52 pm, Rui Maciel <rui.mac...@gmail.com> wrote:
> 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. 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.

--
James Kanze


James Kanze 02-18-2011 11:34 PM

Re: c++ stl
 
On Feb 18, 10:34 pm, Rui Maciel <rui.mac...@gmail.com> wrote:
> Leigh Johnston wrote:
> > 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.


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.

--
James Kanze

James Kanze 02-18-2011 11:35 PM

Re: c++ stl
 
On Feb 18, 11:02 pm, Leigh Johnston <le...@i42.co.uk> wrote:
> On 18/02/2011 22:34, Rui Maciel wrote:


> > Leigh Johnston wrote:


> >> 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.


> **** happens.


:-)

Which is a very succinct summary of what I said in a lot more
words:-).

--
James Kanze

Jorgen Grahn 02-19-2011 12:17 AM

Re: c++ stl
 
On Fri, 2011-02-18, James Kanze wrote:
> On Feb 18, 9:52 pm, Rui Maciel <rui.mac...@gmail.com> wrote:
>> 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.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .


All times are GMT. The time now is 04:06 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.