gen::dereference should perfectly-forward unwrapped values
Summary:
[Folly] `gen::dereference` should perfectly-forward unwrapped values.
The problem comes in when the wrapped value is not actually a pointer, but is actually an rvalue-ref to some other kind of wrapper type with `Inner&& operator*() &&`. In such cases, the compiler emits a type mismatch error that it cannot cast `Inner` to `Inner&&`, with the errors originating in `Dereference::foreach` and `Dereference::apply`.
Fixes a couple other missing-forwarding and extra-forwarding bugs.
Reviewed By: ddrcoder
Differential Revision:
D3776617
fbshipit-source-id:
6926fc18244a572846b22d428bd407d37fb20aa1