title: Requirements for std::thread::id. Can it be atomized?
body: <p>The standard says: "An object of type thread::id provides... a single distinct value for all thread objects that do not represent a thread of execution". Is that a single/distinct value with regard to <code>operator==</code>, or is it the actual bitwise-single/distinct value?</p>
  
  <p>The reason for the question: MSVC2012's <code>std::thread::id::id()</code> leaves garbage in one of its fields, and it breaks code that does compare-exchange on an <code>std::atomic&lt;std::thread::id&gt;</code> (since the latter depends on bitwise comparisons).</p>
  
  <p>Is <code>std::atomic&lt;std::thread::id&gt;</code> a legal construct in the first place?</p>
  
  <p>EDIT: for the reference, the code goes like this:</p>
  
  <pre><code>while( !worker_id.compare_exchange_weak( no_id = thread_id_type(), self_id ) )
      sleep();
  </code></pre>