[thread.thread.assign]

# 32 Concurrency support library [[thread]](./#thread)

## 32.4 Threads [[thread.threads]](thread.threads#thread.thread.assign)

### 32.4.3 Class thread [[thread.thread.class]](thread.thread.class#thread.thread.assign)

#### 32.4.3.5 Assignment [thread.thread.assign]

[ð](#lib:operator=,thread)

`thread& operator=(thread&& x) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1763)

*Effects*: If joinable(), invokes terminate ([[except.terminate]](except.terminate "14.6.2 The std​::​terminate function"))[.](#1.sentence-1)

Otherwise, assigns the
state of x to *this and sets x to a default constructed state[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1769)

*Postconditions*: x.get_id() == id() and get_id() returns the value ofx.get_id() prior to the assignment[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1774)

*Returns*: *this[.](#3.sentence-1)
