我会进入正题,在 thread.h 中,线程的构造函数定义如下。
template<class _Fn,
class... _Args>
explicit thread(_Fn&& _Fx, _Args&&... _Ax)
{ // construct with _Fx(_Ax...)
_Launch(&_Thr,
_STD bind(_Decay_copy(_STD forward<_Fn>(_Fx)),
_Decay_copy(_STD forward<_Args>(_Ax))...));
}
我想知道...是做什么的 我试过谷歌搜索并查看 stackoverflow,但答案似乎无处可寻! 提前谢谢你:)
最佳答案
这是一个 C++11构造,称为 variadic templates (点击链接)
关于c++ - C++ 中的 (...) 参数是做什么的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24379030/