2

I'll get to the point, in thread.h the constructor to a thread is defined with what is below.

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))...));
    }

I was wondering what the ... does I've tried googling and looking on stackoverflow but the answer doesn't seem to anywhere! Thank you in advance :)

Joshua Waring
  • 619
  • 7
  • 23

2 Answers2

4

This is a C++11 construct, called variadic templates (follow the links)

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
2

Its called variadic template. It allows you to write templates with variable number of arguments. As far as I can tell here it allows you to define thread running function returning _Fn type with _Args arguments list by partial binding.

Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64