Documentation Home >> Headers >> <thread> Header >> std::thread >> std::thread::get_id Member Function

Return a value of type std::thread::id that identifies the thread of execution associated with *this.

thread::id get_id() const;

Returns:

If *this has an associated thread of execution, an instance of std::thread::id that identifies that thread. Otherwise returns a default-constructed std::thread::id.

Throws:

Nothing

Header

#include <thread>

See Also