title: Placement new in gcc
body: <p>I need to find a workaround for a bug with placement new in g++. I now it was fixed in gcc-4.3 but I have to support versions 4.2 and 4.1. For example, following code compiles with an error</p>
  
  <p><strong>"error: no matching function for call to 'operator new(long unsigned int, void*&amp;)"</strong></p>
  
  <pre><code>template&lt;class T, template&lt;typename&gt; class Alloc&gt; 
  inline void* type_ctor()
  {
      Alloc&lt;T&gt; a; void* p = a.allocate(1);
      new(p) T;
      return p;
  }
  
  .....
  
  type_ctor&lt;A, NewAllocator &gt;();
  </code></pre>