title: how to printf() std::this_thread::get_id() in C++?
body: <p>I've tried to cast to <code>void*</code> and use <code>%p</code>.  I've also tried <code>intptr_t</code> with a format of <code>%lx</code>.  Both times I get the "Invalid Cast" error.</p>
  
  <p>I'm using <code>-Wall -Werror</code> which checks that the arguments of the <code>printf()</code> match the function's format string.  So I can't merely count on <code>get_id()</code> leaving a 4- or 8-byte value on the stack and simply printing that value as hex.</p>
  
  <p>I'm using gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)</p>
  
  <p>The OS is Fedora release 31 (Thirty One) .  The CPU is 64-bit Intel x86.</p>