Boost logo

Boost :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2006-06-27 16:48:47


Hi,

First of all, I've read the documentation but I couldnt find the
information I'm looking for. In fact the example composite_keys.cpp
confused me even more.

What I want to do is:

I have a record that has two keys: domain and path.
The domain is sorted by its end, so:
.google.com
abc.google.com

.google.com is less than abc.google.com

And path is sorted as usual:

/ is less than /abc

But I'm not being able to figure out how to create a composite key
with both keys.

One question came up with the composite_keys.cpp:

struct name_key:composite_key<
  file_entry,
  BOOST_MULTI_INDEX_MEMBER(file_entry,const file_entry*,dir),
  BOOST_MULTI_INDEX_MEMBER(file_entry,std::string,name)
>{};

The dir member will be ordered by its pointer value right? I cant see
much sense in this ordering since its completely platform independent.
Shouldnt be by its directory name and path?

Thanks in advance,

-- 
Felipe Magno de Almeida

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