title: Statically casting an integer to pointer type
body: <p>I just can't find out how this simple example can be compiled in C++ :</p>
  
  <pre><code>class C
  {
    public:
      static const void* noop = static_cast&lt;const void*&gt; (0x1);
  };
  </code></pre>
  
  <p>Because of the <code>static</code> storage constraint I want, the only cast possible here would be <code>static_cast</code> but it is incompatible with this int-to-ptr cast.</p>
  
  <blockquote>
    <p>error: invalid static_cast from type ‘int’ to type ‘const void*’</p>
  </blockquote>
  
  <p>How can an integer value be statically casted to a pointer type?</p>