title: Custom allocator for STL fails to compile in release mode only
body: <p>I have written a custom allocate which i'm using with std::vector. The code compiles and works when in debug mode, but it fails to compile in release mode with a strange error.</p>
  
  <p>Here is my allocator :</p>
  
  <pre><code>template&lt; class T &gt;
  class AllocPowOf2
  {
  public:
  
     typedef size_t     size_type;
     typedef ptrdiff_t  difference_type;
     typedef T *        pointer;
     typedef const T *  const_pointer;
     typedef T &amp;        reference;
     typedef const T &amp;  const_reference;
     typedef T          value_type;
  
  private:
  
     size_type m_nMinNbBytes;
  
  public:
  
     template&lt; class U &gt;
     struct rebind
     {
         typedef AllocPowOf2&lt; U &gt; other;
     };
  
     inline pointer address( reference value ) const
     {
         return &amp; value;
     }
  
     inline const_pointer address( const_reference value ) const
     {
         return &amp; value;
     }
  
     inline AllocPowOf2( size_type nMinNbBytes = 32 )
      : m_nMinNbBytes( nMinNbBytes ) { }
  
     inline AllocPowOf2( const AllocPowOf2 &amp; oAlloc )
      : m_nMinNbBytes( oAlloc.m_nMinNbBytes ) { }
  
     template&lt; class U &gt;
     inline AllocPowOf2( const AllocPowOf2&lt; U &gt; &amp; oAlloc )
      : m_nMinNbBytes( oAlloc.m_nMinNbBytes ) { }
  
     inline ~AllocPowOf2() { }
  
     inline bool operator != ( const AllocPowOf2&lt; T &gt; &amp; oAlloc )
     {
        return m_nMinNbBytes != oAlloc.m_nMinNbBytes;
     }
  
     inline size_type max_size() const
     {
         return size_type( -1 ) / sizeof( value_type );
     }
  
     static size_type OptimizeNbBytes( size_type nNbBytes, size_type nMin )
     {
        if( nNbBytes &lt; nMin )
        {
           nNbBytes = nMin;
        }
        else
        {
           size_type j = nNbBytes;
  
           j |= (j &gt;&gt;  1);
           j |= (j &gt;&gt;  2);
           j |= (j &gt;&gt;  4);
           j |= (j &gt;&gt;  8);
  
  #if ENV_32BITS || ENV_64BITS
           j |= (j &gt;&gt; 16);
  #endif
  #if ENV_64BITS
           j |= (j &gt;&gt; 32);
  #endif
           ++j; // Least power of two greater than nNbBytes and nMin
  
           if( j &gt; nNbBytes )
           {
              nNbBytes = j;
           }
        }
        return nNbBytes;
     }
  
     pointer allocate( size_type nNum )
     {
        return new value_type[ OptimizeNbBytes( nNum * sizeof( value_type ), 32 ) ]; // ERROR HERE, line 97
     }
  
     void construct( pointer p, const value_type &amp; value )
     {
        new ((void *) p) value_type( value );
     }
  
     void destroy( pointer p )
     {
        p-&gt;~T();
     }
  
     void deallocate( pointer p, size_type nNum )
     {
        (void) nNum;
        delete[] p;
     }
  };
  </code></pre>
  
  <p>Here is the error :</p>
  
  <pre><code>Error   1   error C2512: 'std::_Aux_cont' : no appropriate default constructor available    c:\XXX\AllocPowOf2.h    97
  </code></pre>
  
  <p>The code compiles correctly in debug mode in both Windows with VS2008 and Android with the Android NDK and eclipse.</p>
  
  <p>Any idea ?</p>