|
Boost : |
Subject: Re: [boost] [Review] ITL review questions
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2010-02-25 03:15:09
2010/2/24 Joachim Faulhaber <afojgo_at_[hidden]>
> 2010/2/24 Simonson, Lucanus J <lucanus.j.simonson_at_[hidden]>
>
>> Joachim Faulhaber wrote:
>>
>> > Also, the absorb_neutrons function seems strangely out of place and
>> > has no
>> >> documentation. What does it do?
>> >>
>> >> It removes all value pairs, that have neutral elements as associated
>> >> values
>> > from the map.
>>
>> > Neutron absorption is a fallout of law based testing ;) In many use
>> > cases value pairs of maps can be deleted, if the associated value is
>> > a neutral element which keeps the map more minimal. This is desired
>> > in many cases, but in some it's not.
>> >
>> > Moreover an interval itl::Map of itl::Sets is a model of itl::Set
>> > only, if
>> > it absorbs neutrons.
>> >
>> > For a map that is not a neutron absorber, absorb_neutrons can be
>> > called to discard those elements explicitly.
>> >
>> > See also
>> >
>> http://www.herold-faulhaber.de/boost_itl/doc/libs/itl/doc/html/boost_itl/concepts/map_traits.html
>> >
>> http://www.herold-faulhaber.de/boost_itl/doc/libs/itl/doc/html/boost_itl/semantics/concept_induction.html
>>
>> I think you should rename this function to remove_null or something less
>> misleading.
>>
>
> I thought you'd enjoy a little radioactivity ;-)
>
>>
>> Also, you should probably implement it with a free function and allow the
>> user to specify a value for the neutral element:
>>
>>
> The neutral value is a static property that depends on an itl::Map's
> domain_type and it's Combine functor. The user should not be able to set it
> to arbitrary values. This would spoil the semantical properties of itl
> containers with pretty unknown effects.
>
>
Correction:
The neutral value is a static property that depends on an itl::Map's
codomain_type and it's Combine functor. The user should not be able to set
it to arbitrary values. This would spoil the semantical properties of itl
containers with pretty unknown effects.
..
Joachim
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk