4

This man page states that

Instances of this class may also hold the special distinct value that does not represent any thread.

But I couldn't find nowhere what would be this special value or where it is defined (looked in < thread >). Any ideas?

Yakk - Adam Nevraumont
  • 262,606
  • 27
  • 330
  • 524
CodeMonkey1
  • 123
  • 1
  • 6

1 Answers1

5

The default constructor is documented thusly:

Default-constructs a new thread identifier. The identifier does not represent a thread.

So if you want the not-a-thread identifier, just default-construct an id. The default-constructed value can be compared with any thread id to check if the latter is not-a-thread.

John Zwinck
  • 239,568
  • 38
  • 324
  • 436