Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] named parameter technique with fusion::map
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-11-08 09:25:00


On 11/08/10 06:55, Larry Evans wrote:
[snip]
> Unfortunately, reversing args to airs_nam_ti1_3_t CTOR,
> as in:
>
> pairs_nam_ti1_3_t
> pairs_nam_ti1_3_v
> ( fusion::pair<mpl::int_<2>,ti<2> >(2)
> , fusion::pair<mpl::int_<1>,ti<1> >(1)
> )
>
> causes compile error about "no matching function".
>
> Investigating.

Problem solved By adding a templated member function, put, to
pairs_named template.

Also, renamed overloaded arg function to at_key, since that's
more descriptive.

>
> -Larry
>
> 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?

TIA.

-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