/* This file is part of the mp project. * Copyright (c) 2017 MerryMage * SPDX-License-Identifier: 0BSD */ #pragma once #include #include #include namespace mp { template struct function_info : function_info {}; template struct function_info { using return_type = R; using parameter_list = list; static constexpr std::size_t parameter_count = sizeof...(As); using equivalent_function_type = R(As...); template struct parameter { static_assert(I < parameter_count, "Non-existent parameter"); using type = std::tuple_element_t>; }; }; template struct function_info : function_info {}; template struct function_info : function_info { using class_type = C; }; template struct function_info : function_info { using class_type = C; }; template constexpr size_t parameter_count_v = function_info::parameter_count; template using parameter_list = typename function_info::parameter_list; template using get_parameter = typename function_info::template parameter::type; template using equivalent_function_type = typename function_info::equivalent_function_type; template using return_type = typename function_info::return_type; template using class_type = typename function_info::class_type; } // namespace mp