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" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 > _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost