Subject: Re: [boost] [ICL] interval_map::find(const domain_type_comparable&) instead of interval_map::find(const domain_type&)
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2011-05-23 07:46:20
2011/5/22 Denis <comp.lib.boost.devel_at_[hidden]>:
> Hi Joachim
> One small note about Icl maps.
> I think would be useful to make interval_map::find()'s function accept any
> type comparable to map's key.
> For example, the key type is std::string and the user want to search using a
> 0-terminated string or a string defined as arbitrary pointer and a length.
> Then the user will have to allocate the temporary string only to pass it to
> You may argue that the std::map works same way.
> But there is the difference.
> If I want to do the trick above, I can use boost::multi_index or at
> least instead of std::map<std::string, ValueT> I can define
> something like std::map<tuple<const char*, size_t>, tuple<std::string,
> ValueT>> with key's const char* and size_t pointing to the data hosted in
> This is not possible with interval_map, where the values can be joined
... working with large objects as domain_types in ICL may generally be
unfortunate as it is to do so with std::AssociativeContainers.
If efficiency is not crucial,
(1) it may be ok to create objects temporarily. Otherwise
(2) you may consider dealing with your large objects via
(smart)pointers or iterators or any other proxy technique that allows
you use small proxy objects as domain_type-objects.
-- Interval Container Library [Boost.Icl] http://www.joachim-faulhaber.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk