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