Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] named parameter technique with fusion::map
From: Alfredo Correa (alfredo.correa_at_[hidden])
Date: 2010-11-06 23:11:57


> > Third question: I say in principle because I am stuck here. For
> > example how can I implement a named parameter bind? It seems to me
> > that I am close to achieving this but I don't know exactly how. What I
> > want is some kind of "bind<H, q>(3.0)" which is a function object that
> > effectively evaluates to H( pvalue, 3.0) or to
> > H(make_map<p>(pvariable), 3.0) when calling bind<H, q>(3.0)(pvalue) or
> > bind<H, q>(3.0)(make_map<p>(pvalue)). Note that the most general case
> > is something that defines partial parameters by a map
> > //if H had four parameters:
> > auto b = my::bind<H, set<q1, q2> >( make_map<q1, q2>(3.0, 4.0) ) ;
> > // or my::make_bind<H>( make_map<q1, q2>(3.0, 4.0) )
> > // and then use it as
> > b(make_map<p1, p2>(5.0,6.0));
>
> I do not understand that.
> There is a bind example in libs/fusion/example/cookbook/do_the_bind.cpp
> . Proto might be more helpful here, though.
>

do_the_bind seem to be what I am looking for except that the bind is done by
placeholder number instead of key (named parameter)
in any case I couldn't go far because the do_the_bind.cpp doesn't compile
for me (attached is the error message).





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