Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2003-09-11 18:46:26


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of JOAQUIN LOPEZ MU?Z
> Sent: Thursday, September 11, 2003 2:52 PM
> To: boost_at_[hidden]
> Cc: joaquin_at_[hidden]
> Subject: Re: RE: [boost] Optimization of MPL expression?

[...]

> Btw indexed_set has had a cold response --kinda frustrating :)
> Now that you have downloaded it, have you had the chance to
> take a look at it? Comments, suggestions? Thx in advance.

OK, first I'd like to say that I think this is a great idea and your
implementation looks very good. A few questions/suggestions I thought of:

1) Why use index_list instead of letting the user choose one of the mpl
containers?

2) I can't think of any way to do it, but it would be nice to be able to
say:

   member<&employee::name>

instead of:

   member<employee,int,&employee::name>

maybe this isn't possible.

3) What do you think of the possibility of automatically deducing (unique)
indexes from key type? For instance:

   indexed_set<
      employee,
      unique<member<employee,std::string,&employee::name> >,
      unique<member<employee,double,&employee::height> >,
      unique<member<employee,double,&employee::weight> >
> employees;

   cout << "Bob's age: " << employees.at("bob").age << endl;

This is legal because there is only one unique key type that char* is
convertible to.

   cout << "Employee that weighs 150.3: " << employees.at(150.3) << endl;

This is invalid because 150.3 could refer to height or weight.

---
Anyway, I know I have needed this type of library many times in the past and
I think your implementation of it is excellent.  Have you submitted it for
review?
Brock Peabody

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