Documentation Home >> Headers >> <thread> Header >> std::thread::id >> std::thread::id Less Than Comparison Operator

Compare two instances of std::thread::id to see if one lies before the other in the total ordering of thread ID values.

bool operator<(
    std::thread::id lhs,std::thread::id rhs);

Returns:

true if the value of lhs occurs before the value of rhs in the total ordering of thread ID values. If lhs!=rhs then exactly one of lhs<rhs or rhs<lhs returns true and the other returns false. If lhs==rhs then lhs<rhs and rhs<lhs both return false.

Throws:

Nothing

Note:

The singular not a thread value held by a default-constructed std::thread::id instance compares less than any std::thread::id instance that represents a thread of execution. If two instances of std::thread::id are equal, neither is less than the other. Any set of distinct std::thread::id values forms a total order which is consistent throughout an execution of a program. This order may vary between executions of the same program.

Header

#include <thread>

See Also