Boost logo

Boost :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2004-03-29 01:14:09


Hi Tom

Tom Brinkman ha escrito:

> Comments:
> Again, congratulations on this library.
> I see it, combined with the serialization library , as
> having the potential to eliminate the need for
> relational databases in c++ applications.

Well, IMHO this is a too far-fetched. RDBMS are
sophisticated products with tons of capabilities
that indexed_set is not even close to being able to
emulate. OTOH, if your program needs to store
a personal contacts book, then probably indexed_set
would suffice.

If you're into relational stuff, take a look at
Arkadiy's RTL. I'm hopeful this library can provide
an excellent replacement for "real" databases
when dealing with moderate ammounts of data.
Plus, he'll probably use indexed_set as the storage
core :)

>
> Questions:
> 1) When you add a record to an indexed_set, and it
> violates the index definition in some way, could you
> throw an exception, instead of simply replacing the
> original record?

If the insertion violates some constraint, then it does
not take place. insert operations return a
pair<iterator,bool>: the bool indicates whether insertion
succeeded or not.

>
>
> 2) Is there support for mult-key unique indicies. I
> read in the documenation that you can have more than
> one unique indice in the definition, but they are
> unique individually. Question: Can you combine two or
> more of those unique indice to create a multi-key
> unique indice.
>

Take a look at lex_compare in example 7 for a method
to combine two keys into a "composite" unique constraint.
Most probably I'll lift this construct (along with compose_key
in example 6) to the library itself.

Regards,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk