|
Boost : |
Subject: Re: [boost] De Bruijn Bind (alternate bind syntax) Interest?
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-09-03 21:55:48
On Fri, Sep 3, 2010 at 5:46 PM, Joel de Guzman
<joel_at_[hidden]> wrote:
> We once had outer. The outer solution looked like this:
>
> Â for_each(_1,
> Â Â lambda
> Â Â [
> Â Â Â Â push_back(_1, outer(_2))
> Â Â ]
> Â )
>
> How would that look like if you extend phoenix with your syntax?
>
> It would be good to tackle this through practical use-cases
> and using plain C++ terms. Too much formality hurts my brain.
> If this use-case is too simplistic, then perhaps you can provide
> something more elaborate, yet still practical.
Actually that is pretty close to what I was describing, but imagine
outer being like this to indicate how many levels up to go:
for_each(_1,
lambda
[
push_back(_1, outer<1>(_2))
]
)
Then simplify the syntax by doing something like outer<1,2>, which
could then have a predefined value called _1_2 or so...
I like outer, guess it would be fully powerful if it could specify how
many 'outer' levels to go out to with a template param like the above?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk