|
Boost : |
From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2004-03-24 02:34:59
Hi Joaquin,
you wrote:
> > To try it out I ported the example from
> > http://www.cs.rpi.edu/~musser/stl-book/source/ex18-01.cpp.txt to use
> > indexed_set<>. Port attached. I didn't see a performance penalty. But
the
> > test could be IO bound and I didn't profile.
>
> Is it only me, or did you forget to attach the code?
Nope, we either have a mailing list or an OE problem. Uploaded to
http://groups.yahoo.com/group/boost/files/tcs.cpp
> > I miserably failed to define a composite unique key for my indexed_set.
> > Should this be possible? One more question: is there an (easy?) way to
> > iterate over the distinct values of an index (or to define the index as
the
> > set of distinct values of the related attribute(s))?
>
> Not sure if this is what you're looking for, but please
> take a look at the compose_key class in example 6 of
> the examples section.
I already had. Trying to define
typedef is::indexed_set<
study,
is::index_list<
is::non_unique<is::tag<student_tag>,
is::identity<study>, advisor_comparer>,
is::non_unique<is::tag<advisor_tag>,
is::identity<study>, date_comparer>
is::unique<is::tag<pk_tag>, compose_key<
BOOST_INDEXED_SET_MEMBER(study, string, name),
BOOST_INDEXED_SET_MEMBER(study, string, advisor)
>
>,
>
> tcs_genealogy;
failed to compile in compose_key's
template<typename Arg>
result_type operator()(Arg& arg)const;
and I didn't see how to adapt it.
[...]
> > If JoaquÃn is going to invent indexed_map, too, then indexed_set is OK.
>
> What should we do then with the namespace indexed_sets?
> (mind the final 's')
If namespace boost is not OK, then namespace boost::container probably would
be a better choice.
Best,
Joerg
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk