Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] named parameter technique with fusion::map
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-11-10 01:06:06


On 11/08/10 13:30, Christopher Schmidt wrote:
> Larry Evans schrieb:
>> On 11/08/10 06:55, Larry Evans wrote:
>> [snip]
> [snip]
>>> BTW, just read:
>>>
>>> http://www.boost.org/doc/libs/1_44_0/libs/fusion/doc/html
>>> /fusion/notes.html#fusion.notes.overloaded_functions
>>>
>>> which says:
>>>
>>> There is an overloaded function, f(k), for each key type k.
>>> The compiler chooses the appropriate function given a key, k.
>>>
>>> which is exactly the method used in named_component_ctor.cpp,
>>> where the overloaded function is arg.
>>
>> It's not obvious to me, after looking at:
>>
>> key_of_impl.hpp
>> value_of_impl.hpp
>>
>> in boost/fusion/container/map/detail where this overloaded
>> function, f, is located. (Of course I assume it's not named
>> f, but something like value_of...). Could someone point it out?
>
> Larry,
>
> thanks for your work!
>
> I am responsible for that change. The old implementation, that is the
> implementation up to revision 40392, did lookup values by key type via
> one single overloaded function:
>
> https://svn.boost.org/trac/boost/browser/trunk/boost/fusion/container/map/detail/at_key_impl.hpp?rev=40392#L42
> https://svn.boost.org/trac/boost/browser/trunk/boost/fusion/container/map/detail/lookup_key.hpp?rev=40392#L81
>
> I ditched that when I merged associative iterators from my port back to
> the trunk. I did some benchmarking back then. IIRC, overloaded value
> lookup did worse than the unrolled value lookup.
> Here is the original post:
>
[snip]

The attached looks like a pretty simple map implementation
and may be worth considering. Of course it only works with a
variadic template compiler.

-regards,
Larry




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net