• Marshall Cline's avatar
    fix std::move() of a forwarding-ref - use std::forward instead · 25f4df21
    Marshall Cline authored
    Summary:
    Forwarding refs may hold lvalue-refs as well as rvalue-refs, so generally should be forward'd not move'd (to avoid erroneously consuming an lvalue).
    
    The `initial` param of `folly::reduce(first, last, initial, func)` (also used by `folly::reduce(container, initial, func)`) is a forwarding-ref but the code used `std::move(initial)`. Goal: change that to `std::forward<T>(initial)`.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D7827721
    
    fbshipit-source-id: 12d4ee0ae3cfb0de71269575289c7cd8246eb468
    25f4df21
Future-inl.h 57.6 KB