💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
```c++ #include <stdio.h> template <class T> struct ArgTypes {}; template<class P, class R, class A0> struct ArgTypes<R (P::*)(A0)> { typedef R returns; typedef A0 first; const static int ArgNum = 2; }; template<class R, class A0, class A1> struct ArgTypes<R (*)(A0, A1)> { typedef R returns; typedef A0 first; typedef A1 second; const static int ArgNum = 2; }; struct Node { void m_func(int a); static int s_func(int a, float b); }; void g_func(int a, char c) {} int main () { ArgTypes<decltype(&Node::m_func)>::first a = 1; ArgTypes<decltype(&Node::s_func)>::second b = 0.1; ArgTypes<decltype(&g_func)>::second c = '1'; ArgTypes<int> at; return 0; } ``` 静态成员函数匹配 `*` 而不是 `P::*`,原因详见:https://isocpp.org/wiki/faq/pointers-to-members#fnptr-vs-memfnptr-types