Boost logo

Boost :

Subject: Re: [boost] [Review] ITL review questions
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2010-02-23 21:04:05

Hi Luke,

2010/2/24 Simonson, Lucanus J <lucanus.j.simonson_at_[hidden]>

> Why is the element iterator type a member of the interval set and map class
> when it isn't even applicable for "continuous" domain types? Why not just
> provide a utility iterator adaptor for iterators over intervals that lazily
> generates elements as a separate template class and let people use it where
> it is applicable? There shouldn't be the need to warn the user or depricate
> the element iterators if they aren't class members of the containers and it
> is obvious to the user that they may iterate a large number of time for
> intervals with large extents. I also don't understand why there is an
> itl::map and itl::set since they don't seem to add anything that can't be
> easily accomplished with interval_set and interval_map plus the element
> iterator adaptor or with std::set and std::map. It just isn't clear to me
> what they are for. Also, the absorb_neutrons function seems strangely out
> of place and has no documentation. What does it do?
> I'll probably come up with more questions as I continue the review and I
> don't want to save them up for the end because then we don't get as much
> good discussion.
> thanks again. Obviously your scanning my code ;-)

It's 2:45 am in Europe now and tomorrow I can't be on the list till evening.
So just a short reply. And more tomorrow evening:

If you look on the function synopsis

you can see that all itl::Sets/Maps have a uniform interface, including yes,
member functions add and subtract (in addition to insert and erase). I use
itl::maps of elements in other projects to e.g. aggregate associated values
for keys of tuples to compute things like cross tables. As I said elsewhere
the aggregate on collision feature is pretty useful in different ways.

I'm also using the element containers to validate the implementations
against each other using law based tests:

absorb_neutrons is also used to validate semantical properties in the law
ProtonicEquality here:

More tomorrow,
Good night

Boost list run by bdawes at, gregod at, cpdaniel at, john at