Boost logo

Boost :

Subject: Re: [boost] Interest in an 'either' library?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2013-06-26 16:03:53


On 26/06/13 01:24, Giovanni Piero Deretta wrote:
> On Tue, Jun 25, 2013 at 11:14 PM, Eric Niebler <eniebler_at_[hidden]> wrote:
>> On 13-06-25 01:53 AM, Giovanni Piero Deretta wrote:
>>> On Mon, Jun 24, 2013 at 8:19 PM, Eric Niebler <eniebler_at_[hidden]> wrote:
>>>> On 13-06-24 11:53 AM, Pierre Talbot wrote:
>>>>>>
>>> [...]
>>>> And while I'm thinking of it, I see lots of potential with try_call and
>>>> C++14's generic lambdas. Wish I had a compiler that implements them. In
>>>> the above, if h is not something that can be passed as a parameter,
>>>> you'd want this:
>>>>
>>>> try_call([](auto &&...args){return
>>>> h(forward<decltype-dance>(args)...);})(f(), "hello world", g(), 42);
>>>>
>>>> This begs to be wrapped up in a macro.
>>>>
>>>
>>> Yet another use case for n3617:
>>>
>>> try_call([]h)(f(), "hello world", g(), 42);
>>
>> Oooh, that's nice. Has this been discussed yet in committee?
>>
>>> See https://github.com/gpderetta/Experiments/blob/master/tests/quote_test.cc
>>> for a C++11 macro based proof-of-concept implementation.
>>
>
> As far as I know it hasn't been discussed at last meeting. Not sure
> whether for lack of time or lack of a sponsor.

Probably lack of a sponsor.
It's just syntactic sugar. You could just write INVOKABLE(h), with
INVOKABLE a suitably defined macro, to achieve exactly the same thing.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk