25 Jun
2013
25 Jun
'13
8:53 a.m.
On Mon, Jun 24, 2013 at 8:19 PM, Eric Niebler
[...] 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
On 13-06-24 11:53 AM, Pierre Talbot wrote: 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); See https://github.com/gpderetta/Experiments/blob/master/tests/quote_test.cc for a C++11 macro based proof-of-concept implementation. -- gpd