R
Ramon F Herrera
I am looking for a good excuse to pick up C++. I have been a satisfied
C programmer for years, a language that provides me all the facilities
that I need, with ONE exception.
I keep on finding programming problems that can be nicely solved by
the use of relational arrays. I wish I could count on the simplicity
of expression afforded by Java:
array.put(key, data);
or -even better- by Perl:
pictureOf{"ramon"} = myimage.gif; // or something to that effect
My question is two-fold:
(1) Which relational array implementation should I use? A while ago I
posted a similar question in this NG and I was surprised to read that
one of the recommended packages was Berkeley DB from Sleepycat (Oracle
property these days). Since I was referring to RAM-based arrays, I was
told that all I had to do is keep it in RAM instead of the normal disk-
based database file. Berkeley DB has a heavier footprint for what I
have in mind. Isn't there an implementation of relational arrays in
the standard, or even in the de facto commonly used C++ libraries?
(2) Let's say I found a perfect implementation that suits my needs. Is
there a way to overload the bracket operators to make them behave like
in Perl? Please don't tell me that the only interesting/elegant case
of operator overloading is in complex arithmetic!
TIA,
-Ramon
C programmer for years, a language that provides me all the facilities
that I need, with ONE exception.
I keep on finding programming problems that can be nicely solved by
the use of relational arrays. I wish I could count on the simplicity
of expression afforded by Java:
array.put(key, data);
or -even better- by Perl:
pictureOf{"ramon"} = myimage.gif; // or something to that effect
My question is two-fold:
(1) Which relational array implementation should I use? A while ago I
posted a similar question in this NG and I was surprised to read that
one of the recommended packages was Berkeley DB from Sleepycat (Oracle
property these days). Since I was referring to RAM-based arrays, I was
told that all I had to do is keep it in RAM instead of the normal disk-
based database file. Berkeley DB has a heavier footprint for what I
have in mind. Isn't there an implementation of relational arrays in
the standard, or even in the de facto commonly used C++ libraries?
(2) Let's say I found a perfect implementation that suits my needs. Is
there a way to overload the bracket operators to make them behave like
in Perl? Please don't tell me that the only interesting/elegant case
of operator overloading is in complex arithmetic!
TIA,
-Ramon