Using C++ and STL

Stephen van Egmond (svanegmond nospam at home.com)
Sun, 27 Jun 1999 01:18:02 EDT

Someone pointed out that some developers might not feel comfortable
using C++ and the STL. Is this a current concern?

I'm not thinking about using anything particularly odd in C++ (a
class), or the STL (strings, arrays). String-handling in C is as
stupid as it gets and std::string adds so much more. I can imagine the
CDindex library returning a struct of strings which are... what, malloc
-ed? The rule being that you must free all the sub-members before
freeing the struct, etc. etc. Bleagh.

On the other hand, something like so:

class CDIndex_Track {
public:
std::string name;
std::string artist; // optional
};

class CDIndex_CD {
public:
std::string title;
std::string artist;

std::list<CDIndex_Track> track_list;
};

... is ridiculously easy to manage. The strings are printable; you can
get a char* trivially; iterating through the track list is easy (a cut-
and-paste for loop at the worst); deleting the _CD object nukes
everything that hangs off it.

Is there any work going on on the client library, or am I cutting new
ground here?