title: How to get integer thread id in c++11
body: <p>c++11 has a possibility of getting current thread id, but it is not castable to integer type:</p>
  
  <pre><code>cout&lt;&lt;std::this_thread::get_id()&lt;&lt;endl;
  </code></pre>
  
  <p>output : 139918771783456</p>
  
  <pre><code>cout&lt;&lt;(uint64_t)std::this_thread::get_id()&lt;&lt;endl;
  </code></pre>
  
  <p>error: invalid cast from type ‘std::thread::id’ to type ‘uint64_t’
  same for other types:
  invalid cast from type ‘std::thread::id’ to type ‘uint32_t’</p>
  
  <p>I really dont want to do pointer casting to get the integer thread id. Is there some reasonable way(standard because I want it to be portable) to do it? </p>