Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What part of STL knowledge is must for a C++ developer?

Tags:

stl

I have good knowledge of C++ but never dwell into STL. What part of STL I must learn to improve productivity and reduce defects in my work?

Thanks.

like image 980
LionHeart Avatar asked Dec 04 '22 21:12

LionHeart


2 Answers

I have good knowledge of C++

With all due respect, but no – you don’t. The standard library, or at least large parts of it (especially the subset known as “STL”) is a fundamental part of C++. Without knowledge of it you don’t know very much about C++ at all.

In fact, much of the modern design of C++ (essentially everything since the 98 version) was guided by design considerations stemming from the standard library, and much of the changes in the language since then are changes to the standard library. If you take a look at the official C++ language description a good part of the document is concerned with the library.

like image 200
Konrad Rudolph Avatar answered Jan 03 '23 14:01

Konrad Rudolph


Usually the first reaction (at least in my opinion, of course) for people who have not worked with the STL before is to get upset with all the template code. So I would start by studying a little bit on this subject.

In the case you already know template fundamentals I would recommend taking a brief look over an STL design document. This is actually the second stage of hassle for people not yet familiar with it. The reason for this is that the STL is not designed under a typical object oriented paradigm, but under the generic programming paradigm.

With this in mind, a good start could be this introductory article. The terms used throughout the STL components are explained there. Please notice that is a relatively old text focused on the SGI implementation (which predates the C++ standard and incorrectly mentions, for example, the hash based containers as part of it). However, the theory is still valid.

Well, if you already know most things I've said up to this point, just jump directly to the topcis the others provided.

like image 22
Leandro T. C. Melo Avatar answered Jan 03 '23 13:01

Leandro T. C. Melo