Fix passing MoveWrapper into lambdas
authorAlex Landau <alandau@fb.com>
Tue, 29 Oct 2013 21:06:18 +0000 (14:06 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 6 Nov 2013 01:35:18 +0000 (17:35 -0800)
commite14cd5e1ff7cea2f607d2b1741a26942745965af
treeb5a42363b95a7bfd776fb6362127a9fa948b42b8
parentc21eba0d8db43365c0e80fd86389e90fab9c13c4
Fix passing MoveWrapper into lambdas

Summary:
GCC can't compile code that passes a MoveWrapper into a lambda
in some cases. For example if the capture list has
[someConstObject, myMoveWrapper], gcc 4.7 fails. This specific case
works with gcc 4.8, but other cases (e.g. [this, myMoveWrapper]) still
fail.

This diff is a hack that makes code like that compile. It can be
removed, along with MoveWrapper itself once we move to C++14 with its
extended lambda syntax.

Test Plan: fbmake

Reviewed By: hans@fb.com

FB internal diff: D1032585
folly/MoveWrapper.h