[gecode-users] [icl] 'map::_add' ignores default-constructed value

Filip Konvička filip.konvicka at logis.cz
Thu Oct 29 15:26:26 CET 2015


Sorry, wrong list again :(
I apologize, this was intended for boost.users.

Filip

> Hi,
>
> First of all thanks very much for the ICL!
>
> I'm using a boost::icl::interval_map with my own value type (struct V)
> and I have a custom value combining logic by passing
> boost::icl::inplace_et to the map and defining my own "operator&=" that
> provides the logic implementation.
>
> Now what happens is that my map ignores "m += make_pair(..., V())"
> because the default-constructed value is considered neutral due to:
>
> boost/icl/interval_base_map.hpp:
>
> ... interval_base_map<...>::_add(const segment_type& addend) {
>      typedef typename on_absorbtion<type,Combiner,
> absorbs_identities<type>::value>::type on_absorbtion_;
> ...
>      const codomain_type& co_val = addend.second;
>      if(on_absorbtion_::is_absorbable(co_val))
>          return this->_map.end();
>
> This 'if' returns without actually modifying the map. Is there some
> public API that I can use to tell my map that it should not consider any
> value 'absorbable'?  And is it a good idea to change this?
>
> Thank you,
> Filip





More information about the users mailing list