https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67114
--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> --- So I suggest something like: friend bool operator<(thread::id __x, thread::id __y) noexcept - { return __x._M_thread < __y._M_thread; } + { +#ifdef PTW32_VERSION + // implement operator< explicitly in terms of the internals of + // pthreads-win32's ptw32_handle_t. + return std::tie(__x._M_thread.p, __x._M_thread.x) + < std::tie(__y._M_thread.p, __y._M_thread.x); +#else + // Pthreads doesn't define any way to do this, so we just have to + // assume native_handle_type is LessThanComparable. + return __x._M_thread < __y._M_thread; +#endif + } On trunk operator== is different to the gcc-5-branch, so would require a similar change.