|
Boost : |
From: Arkadiy Vertleyb (arkadiy_at_[hidden])
Date: 2003-07-01 09:10:02
If I understand correctly, with your approach:
(a, b, null) == (a, b, c1), and
(a, b, null) == (a, b, c2), but
(a, b, c1) != (a, b, c2)
If this is correct, I am afraid that whether or not such a predicate works
correctly may depend on a particular implementation of std::set...?
Arkadiy
"Ed Brey" <brey_at_[hidden]> wrote in message
news:bdq43b$n4m$1_at_main.gmane.org...
> Arkadiy wrote:
> > Right now we are using a sorted vector instead of a set, to implement
> > our relational tables, because set doesn't allow us to search on a
> > prefix of a key. Like if a table is indexed on a, b, c, we are not
> > able to use equal_range on a, b with the set.
>
> I was able to successfully use a set for the indices into an in-memory
database I wrote for my company a few years back. By providing a custom
Compare object, I was able to implement prefix-based seeking using
equal_range. I allowed an element to indicate that it is truncated (e.g.
contains only a and b, but not c). The Comparison function used the
indication when checking whether one element is less than another.
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk