std::tr1::函数如何获取签名特性的参数并专门化类*

How std:: tr1:: function gets the parameters of the signature features and specializes the class*

本文关键字:参数 专门化 函数 tr1 何获取 std 获取      更新时间:2023-10-16

我想知道std::function是如何从您传入的函数类型中确定参数和参数的。

这是一个部分模板专用化。

template<typename T> class function;
template<typename Ret> class function<Ret()> { ... };
template<typename Ret, typename Arg1> class function<Ret(Arg1)> { ... };

正如您所看到的,这将很快变老,但可变模板将在C++0x中处理它。