[Pipet Devel] GConf, Loci, pickles, etc.
Jean-Marc Valin
jean-marc.valin at hermes.usherb.ca
Sat Jun 10 13:44:13 EDT 2000
> > question. However, I can say that once you've started using the STL, you never
> > want to go back. It's so simple and intuitive to use. For example, you can use a
> > "string" type as if it were an int, with all the operators and never caring
> > about deleting pointers, ...
>
> Hehe, this is the feeling I have with glib :)
Here are a couple things you can do with the STL:
int main() {
map<string,int> months;
months["january"] = 31;
months["february"] = 28;
///and so on
cout << "january has " << january["january"] << " days" << endl;
}
Note that this program doesn't leak. Also, unlike glib, the STL can have vectors
and lists of objects (like vector<string>) and not only lists of object
pointers. Also, because of destructors objects automatically delete their
resources when they go out of scope. I think that all (almost) everything in
glib has a STL equivalent that's also likely to be simpler to use.
Jean-Marc
--
Jean-Marc Valin
Universite de Sherbrooke - Genie Electrique
valj01 at gel.usherb.ca
More information about the Pipet-Devel
mailing list