Boost logo

Boost :

From: Darren Cook (darren_at_[hidden])
Date: 2004-03-02 22:02:38


Hi,
Some thoughts on design/naming after reading docs of indexed_set (version
9). I've not tried compiling anything yet.

1. The naming here seems redundant:
     employee_set::nth_index_type<1>::type
     employee_set::index_type<name>::type

    Can't the "::type" bit be dropped"? Or the _type, e.g.
     employee_set::nth_index<1>::type
     employee_set::index<name>::type

2. Do tags have to be structs?
    struct name{};
    ...
    non_unique<tag<name>,member<employee,std::string,&employee::name>
    ...
    employee_set::index_type<name>::type

    While it looks okay in tutorial examples, I can see not wanting that in
the main namespace in a real program. But then having to use a namespace
each time I use the tag will be make it a bit ugly:
    non_unique<tag<tags::name>,member<employee,std::string,&employee::name>
    ...
    employee_set::index_type<tags::name>::type

    If it was a string instead is it less efficient (or maybe it does not
compile)?
    non_unique<tag<"name">,member<employee,std::string,&employee::name>
    ...
    employee_set::index_type<"name">::type

3. I think the compose_key example will be needed enough that it should be
part of the main library.

4. I think some macros would be useful to enhance readability (rather than
just to handle compiler incompatibilities as currently). I'll see what I
come up with as I try to use the library.

Darren


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