C ++ 11 thread :: id a special value that does not represent a thread

This man page states that

Instances of this class can also contain a special single value that does not represent any thread.

But I could not find anywhere that this special value or where it is defined (see <thread>). Any ideas?

+3


source to share


1 answer


The default constructor is documented like this:

By default, a new thread ID is created. The identifier does not represent a stream.



So, if you want a non-thread id, just build by default id

. The default constructed value can be compared against any thread id

to check if the last one is.

+4


source







All Articles