LeszekSwirski/lazyargs

LAZY macro

Closed this issue · 1 comments

I suggest you to replace

#define LAZY(EXPR) make_lazy([&]{ return EXPR; })

with

#define LAZY(...) make_lazy([&]{ return __VA_ARGS__; })

This will allow to pass expressions with commas without extra parentheses. And also you may add more complicated form

#define LAZY2(...) make_lazy([&]{ __VA_ARGS__; })

to use:

foo(LAZY2(
std::stringstream ss;
//blah-blah
return ss.str();
));

Nice suggestion, done.