Hans Åberg wrote: > >> The idea would be to write something equivalent to > >> return make_unique<foo>($1, $2, $3); > >> and the Bison writes something like > >> $$ = std::move(action_k(...return make_unique<foo>($1, $2, $3);...)) > > > > I don't follow you. What is action_k, and how would that cause > > moving from $1 etc.? > > Action k in the switch statement.
Huh? I really don't get what your proposed syntax is supposed to mean. Is action_k supposed to be a lambda (what else could appear in an expression and contain a statement inside)? What would it do? > Move operators were originally designed to avoid copying in returns. I don't know if this was so or not originally, but I'm talking about moving arguments, not return values. That's what I've been saying the whole time, including the thread subject! Moving the return value is no big problem most of the time: "$$ = make_unique ..." works without any std::move because a function result(*) is automatically an rvalue. (*) Nitpick: unless it's declared of lvalue-reference type which is not the case here. I'm afrading you're barking up the wrong tree. Regards, Frank