• tzik's avatar
    Readd base::UnwrapTraits to support rvalue-reference wrappers · 001315c4
    tzik authored
    base::Bind implementation uses the function overload resolution with ADL
    to dispatch bound parameters to Unwrap function. However, this works only
    when the bound parameter is passed as a const reference. And other form
    of bound parameters, such as rvalue-reference, are fallback to default
    Unwrap and fails to compile.
    This CL introduces UnwrapTraits<> as a traits struct, and converts Unwap()
    function to UnwrapTraits<>::Unwrap(), so that the unwrapping function is
    looked up by the normalized type name.
    Review-Url: https://codereview.chromium.org/2250373002
    Cr-Commit-Position: refs/heads/master@{#415008}
bind_helpers_unittest.cc 1.38 KB