有没有办法获取函数参数的类型?

问题描述 投票:0回答:0

即:

// a function declaration
int my_function( float a, double b );

// get the function's argument type by position
some_template<my_function,1>::type aaa; // float aaa
some_template<my_function,2>::type bbb; // float bbb

有没有可能实现它(尤其是在像 14 这样的旧 C++ 版本中)?

c++ templates metaprogramming introspection
© www.soinside.com 2019 - 2024. All rights reserved.