std::thread::thread

From Cppreference

Jump to: navigation, search
thread();
(1) (C++11 feature)
thread( thread&& other );
(2) (C++11 feature)
template< class Function, class ...Args >
explicit thread( Function&& f, Args&&... args );
(3) (C++11 feature)

Constructs new thread object.

1) Creates new thread object which does not represent a thread.

2) Move constructor. Constructs the thread object with the state of other using move semantics.

3) Creates new thread object and associates it with new thread, which executes the given function f. f is invoked as f(args...). Any exceptions during construction of the arguments are thrown in the current thread, not the new thread.

[edit] Parameters

other - another thread object to construct this thread object with
f - function to execute in the new thread
args... - arguments to pass to the new function

[edit] Exceptions

1-2)
noexcept specification:  
noexcept

  (C++11 feature)
3) std::system_error if the thread could not be started. Error condition: resource_unavailable_try_again