// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_THREADING_SEQUENCE_BOUND_INTERNAL_H_ #define BASE_THREADING_SEQUENCE_BOUND_INTERNAL_H_ #include #include "base/compiler_specific.h" namespace base { namespace internal { // Helpers to simplify sharing templates between non-const and const methods. // Normally, matching against a method pointer type requires defining both a // `R (T::*)(Args...)` and a `R (T::*)(Args...) const` overload of the template // function. Rather than doing that, these helpers allow extraction of `R` and // `Args...` from a method pointer type deduced as `MethodPointerType`. template struct MethodTraits; template struct MethodTraits { using ReturnType = R; using ArgsTuple = std::tuple; }; template struct MethodTraits { using ReturnType = R; using ArgsTuple = std::tuple; }; template using ExtractMethodReturnType = typename MethodTraits::ReturnType; template using ExtractMethodArgsTuple = typename MethodTraits::ArgsTuple; } // namespace internal } // namespace base #endif // BASE_THREADING_SEQUENCE_BOUND_INTERNAL_H_