title: Truly compile-time string hashing in C++
body: <p>Basically I need a truly compile-time string hashing in C++. I don't care about technique specifics, can be templates, macros, anything. All other hashing techniques I've seen so far can only generate hashtable (like 256 CRC32 hashes) in compile time, not a real hash.</p>
  
  <p>In other words, I need to have this</p>
  
  <pre><code>printf("%d", SOMEHASH("string"));
  </code></pre>
  
  <p>to be compiled as (in pseudo-assembler)</p>
  
  <pre><code>push HASHVALUE
  push "%d"
  call printf
  </code></pre>
  
  <p>even in Debug builds, with no runtime operations on string. I am using GCC 4.2 and Visual Studio 2008 and I need the solution to be OK for those compilers (so no C++0x).</p>