Subject: Re: [boost] [TypeErasure]
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2012-07-24 10:39:44
On Jul 24, 2012 9:35 AM, "Larry Evans" <cppljevans_at_[hidden]> wrote:
> On 07/23/12 14:42, Lorenzo Caminiti wrote:
> > On Mon, Jul 23, 2012 at 3:30 PM, Steven Watanabe <watanabesj_at_[hidden]>
> >> On 07/23/2012 11:17 AM, Markus Werle wrote:
> >>> Steven Watanabe wrote:
> >>>> On 07/22/2012 07:21 AM, Markus Werle wrote:
> >>>>> I have one question: proto and spirit use _1, _2, etc.
> >>>>> TypeErasure uses _a, _b, _c ...
> >>>>> What was your reason to introduce yet another placeholder set?
> >> It isn't exactly identical. The names _1, _2
> >> carry extra meaning about how they are substituted
> >> which doesn't make sense for my library.
> >>>> I eventually decided that since the placeholders represented named
> >>>> parameters instead of positional parameters, letters were more
> >>>> appropriate than numbers.
> > I've asked the same question "why _a, _b, etc instead of _1, _2, etc"
> > a while back. Steven replied, it's because _a, _b, etc are
> > placeholders for named parameters and not for positional parameters
> Hmm... seems like they're names for types, not parameters.
> I'm thinking they're somewhat like:
Parameters as in either function or template paramters, template paramters
can be types.
> template<typename _a, typename _b, ...>
> struct te
> te(_a a_val, _b b_val, ... )
> : my_a(a_val), my_b(b_val)
> _a my_a;
> _b my_b;
> I haven't thought it through that well, but the above
> analogy may be some help in justifying the use of
> names instead of types. In addition, just as shown in
> the construction_map_tuple.cpp code attached to:
> the order is only implied if you use tuple. If you use
> any to create the parameter, there's no order imposed.
No order means the parameters are not positional so _1, etc would be
> For example, the following snippet of code from
> the .cpp file:
> //Something similar using bindings and just any's.
> te::any<requirements, _a>
> te::any<requirements, _b>
> te::any<requirements, _a> bnd_displaced_value_ptr_v(bnd_value_ptr_v
> + bnd_displacement_v);
> Shows an a_ created, then a _b createe, then another _a created.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk