Oops, I attached the wrong file in my previous e-mail. Should be fixed now. Daveed
Attachment:
SFINAE_diffs-3
Description: Binary data
On Aug 11, 2010, at 1:54 PM, David Vandevoorde wrote: > Attached are updated diffs for the ABI spec. Besides a couple of minor fixes, this includes an updated treatment of parameter references in signature expressions. There was a separate thread discussing nested function declarators, but at the recent Rapperswil meeting of WG21, an additional issue came up. Consider: > > template<class T> auto f(T const x)->decltype(x); // #1 > template<class T> auto f(T x)->decltype(x); // #2 > > Ordinarily, top-level cv-qualifiers are ignored when forming the function type. E.g., "int(*)(T)" and "int(*)(T const)" are the same type. However, in expression contexts we cannot ignore the cv-qualifiers because the expression must mean the same there as it would if it appeared in the function definition (where cv-qualifiers matter). > > So #1 and #2 above must be distinct templates. Rather than encoding the cv-qualifier on the parameter type of the template signature (which would presumably be a serious break of backward compatibility), we're proposing to encode it in the reference in expression contexts (except for known non-class types in rvalue contexts, where the cv-qualifier is meaningless). E.g., rather than encoding "decltype(x)" in #1 as "Dtfp_E" (as we'd do for #2) we use "DtfpK_E". > > As usual, feedback is welcome. > > Thanks, > > Daveed > > > <SFINAE_diffs-3>