// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include namespace Common { template struct FuncTraits; // Function type template struct FuncTraits { using ReturnType = ReturnType_; static constexpr size_t NUM_ARGS = sizeof...(Args); template using ArgType = std::tuple_element_t>; }; // Function pointer template struct FuncTraits : FuncTraits {}; // Member function pointer template struct FuncTraits : FuncTraits {}; template struct FuncTraits : FuncTraits {}; // Catch-all for callables template struct FuncTraits::operator())>> : FuncTraits::operator())> {}; // For lambdas: for compat (may be removed) template struct LambdaTraits : LambdaTraits::operator())> {}; template struct LambdaTraits { template using ArgType = std::tuple_element_t>; static constexpr size_t NUM_ARGS{sizeof...(Args)}; }; } // namespace Common