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 13:45:09


On 11/08/10 08:25, Larry Evans wrote:
[snip]
> 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.

The attached is a further simplification. Instead of 2
folds, only 1 is used and the resulting structure is
really a map, map_default<P1,P2,...,Pn>, which allows
the user to select which args to specify in the CTOR.
One disadvantage is such a CTOR causes a
default initialization of some values which are
immediately overwritten by the call to put(value_pairs...)
in the CTOR. Maybe another disadvantage is inheriting
the values(instead of using fusion::vector) consumes more
space. Haven't tested.

-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