<br><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 2, 2012 at 11:49 AM, Iestyn Bleasdale-Shepherd <span dir="ltr"><<a href="mailto:iestyn@valvesoftware.com" target="_blank">iestyn@valvesoftware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Dmitri - thanks for the response!<br>
<br>
The line you quote ends with "...where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation."<br>
<br>
This qualification allows disambiguation between my two example functions - as it must, since they may have completely different implementations and may be passed as different function pointers.<br>
<br></blockquote><div><br></div><div>According to the rules of C++, the two declarations</div><div>  void Func(char array[32]);<br></div><div>and</div><div>  void Func(char array[16]);</div><div>declare the same function, which has one parameter of type char*.  They declare the same function as</div>
<div>  void Func(char *array);</div><div><br></div><div>It is an error to define both of them -- the following should generate a diagnostic from any conforming C++ compiler:</div><div><div>  void Func(char array[32]) {}</div>
<div>  void Func(char array[16]) {}</div></div><div><br></div><div>And it does so with Clang:</div><div><br></div><div><div>/tmp/redecl.cc:2:6: error: redefinition of 'Func'</div><div>void Func(char array[16]) {}</div>
<div>     ^</div><div>/tmp/redecl.cc:1:6: note: previous definition is here</div><div>void Func(char array[32]) {}</div><div>     ^</div><div>1 error generated.</div></div><div><br></div><div><br></div><div>(It's true that arrays are not pointers, and pointers are not arrays, but in the special case of function declarations there is no way to pass an array by value, and the only way to constrain the size of a passed array is to pass a pointer or reference to a particular size of array.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Am I missing something here? We use these kinds of overloads in our code, in cases which depend on their resolving to *different* functions.<br></blockquote><div><br></div><div><br></div><div>That's not possible in C++.  Maybe you can show your actual code?</div>
<div><br></div><div>-- James</div><div><br></div></div></div>