From: Albert on
Albert wrote:
> <snip>
> Is there a good tutorial on C++ you would recommend, covering especially
> the STL, on the internet for C programmers?
> <snip>

Read up to Chapter 17 of http://www.4p8.com/eric.brasseur/cppcen.html;
that should be enough information about templates to move on to
http://www.sgi.com/tech/stl/stl_introduction.html. That should be enough
to get though most of the documentation after reading the section about
iterators.

This should be enough for C programmers to be able to basically use the
STL when time is short for coding up tricky data structure operations :)

P.S. Where's the balanced binary search tree in the STL?

Albert
From: Richard Heathfield on
Albert wrote:

<snip>

> P.S. Where's the balanced binary search tree in the STL?

Questions about std::map are off-topic in comp.lang.c. In comp.lang.c++
and alt.comp.lang.learn.c-c++, however, the answer to your question is
std::map, for which you need to #include <map>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within
From: Jerry Coffin on
In article <dG76n.2639$pv.540(a)news-server.bigpond.net.au>,
albert.xtheunknown0(a)gmail.com says...

[ ... ]

> P.S. Where's the balanced binary search tree in the STL?

std::[multi](set|map);

--
Later,
Jerry.
From: Ronald Landheer-Cieslak on
[removed comp.lang.c from the newgroup list - the STL doesn't belong there]

Bas wrote:
> IMHO I dont think you can understand STL really well if you don't know
> C++ really well.
STL is about two things: iterators and algorithms. The ADT classes and
somesuch that can be found in the STL are nice, but they're candy. You
don't have to know anything about OOP or about C++ to understand
iterators or to understand algorithms, nor to understand ADTs, for that
matter.

A good C programmer will know about iterators - perhaps not about all
the iterator concepts the designers of standard C++ (and Boost) came up
with, but those are easy enough to understand without in-depth knowledge
of C++. The idea of an iterator is easy to grasp for a C programmer:
it's just like a pointer into an array, but you abstract away both the
pointer and the array.

Any good programmer, no matter what the language, will know about
algorithms and will understand that the algorithms in the STL can be
applied to ranges which are delimited using iterators.

Now, as for the "T" in STL: for a C programmer it can be seen as a way
to get rid of void* and it is honestly not such an important part of the
STL that you'd have to understand all about template meta-programming in
order to be able to use it.

I'd recommend "Generic Programming and the STL" by M.A. Austern. IMO it
puts the emphasis where it should be.

rlc

--
Ronald Landheer-Cieslak
Software Development Professional
http://landheer-cieslak.com
http://vlinder.ca

--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---