Listing 8: Sort order.

template<class Table, class SubTuple>
  range_t<typename Table::const_iterator>
  selection_eq(const Table& t, const SubTuple& s)
{
  return t.equal_range(s);
}
template<class Table, class SubTuple>
  range_t<typename Table::const_iterator>
  selection_lt(const Table& t, const SubTuple& s)
{
  return range(t.begin(), t.lower_bound(s));
}