title: Why can't I specify the calling convention for a constructor(C++)?
body: <p>In Visual Studio 2013 a new calling convention <code>_vectorcall</code> exists. It is intended for usage with SSE data types that can be passed in SSE registers.</p>
  <p>You can specify the calling convention of a member functions like so.</p>
  <pre><code>struct Vector{//a 16 byte aligned type
  _m128i _vectorcall operator *(Vector a); 
  };  
  </code></pre>
  <p>This works, it compiles, and the type can be passed by value despite having 16 alignment requirements.</p>
  <p>On the other hand if I try to attach it to any constructors (which seems perfectly logical), it fails.</p>
  <pre><code>struct Vector
   _vectorcall Vector(SomeOtherTypeWith16Alignment a);
  }; 
  </code></pre>
  <p>The compiler spits out the warning message (I have warnings as errors):</p>
  <blockquote>
  <p>warning C4166: illegal calling convention for constructor/destructor.</p>
  </blockquote>
  <p>Forcing me to change the code to this:</p>
  <pre><code>struct Vector{
     Vector(SomeOtherTypeWith16Alignment a); //fails to compile
  }; 
  </code></pre>
  <p>Which also fails to compile because now <code>SomeOtherTypeWith16Alignment</code> can't be passed by value since <code>_vectorcall</code> isn't enabled on the constructor.</p>
  <p>So I am forced to change it to this.</p>
  <pre><code>struct Vector{
    Vector(const SomeOtherTypeWith16Alignment&amp; a);
  };
  </code></pre>
  <p>Which compiles. But it is no longer using <code>_vectorcall</code> and likely won't pass the data in SSE registers as I'd prefer...</p>
  <p><strong>So basically, why the hell can't I specify the calling convention used by constructors?</strong></p>
  <p>This may be Visual C++ specific (<code>_vectorcall</code> certainly is). I have not tried this on other compilers--</p>