## STD-DISCUSSION | |

**Subject:** Some confusion about the transformed function type during partial ordering

**From:** jim x (*xmh970252187_at_[hidden]*)

**Date:** 2020-09-16 04:06:36

**Next message:**Farid Mehrabi: "Making the new expression smart"**Previous message:**jim x: "Re: The issue about the wording "member of a class""

Hi, everyone.

According to the following rules:

Two sets of types are used to determine the partial ordering. For each of

the templates involved there is the* original function type *and the

*transformed

function type*. [ Note: The creation of the transformed type is described

in [temp.func.order]

<https://timsong-cpp.github.io/cppwp/n4659/temp.func.order>. â€” end note ]

The deduction process uses the transformed type as the argument template

and the original type of the other template as the parameter template.

And the transformed processes are described as the following:

To produce the transformed template, for each type, non-type, or template

template parameter (including template parameter packs

<https://timsong-cpp.github.io/cppwp/n4659/temp.variadic#def:template_parameter_pack>

thereof)

synthesize a unique type, value, or class template respectively and

substitute it for each occurrence of that parameter in the function type of

the template. [ Note: The type replacing the placeholder in the type of the

value synthesized for a non-type template parameter is also a unique

synthesized type. â€” end note ] *If only one of the function templates **M is

a non-static member of some class A, M is considered to have a new first

parameter inserted in its function parameter list. Given cv as the

cv-qualifiers of M (if any), the new parameter is of type â€œrvalue reference

to cv Aâ€ if the optional ref-qualifier

<https://timsong-cpp.github.io/cppwp/n4659/dcl.decl#nt:ref-qualifier>

of M is && or

if M has no ref-qualifier

<https://timsong-cpp.github.io/cppwp/n4659/dcl.decl#nt:ref-qualifier> and

the first parameter of the other template has rvalue reference type.

Otherwise, the new parameter is of type â€œlvalue reference to cv Aâ€. *

So, I have a confusion here, Is the "first parameter inserted in its

function parameter list" considered as the process for making transformed

function type? If it is, how to interpret this example:

struct A { };

template<class T> struct B {

template<class R> int operator*(R&); // #1

};

template<class T, class R> int operator*(T&, R&); // #2

when during the partial ordering, the original type for `#1` is `int(R&)`,

the transformed type for `#1` is `int(B<T>&, R&)` and, the original type

and transformed type for `#2` are all `int(T&,R&)`. That means, the

original type for `#1` does not have the same number parameters as that of

transformed type for `#2`.

Hence, my question is , Is the result of the process which is bolded in the

above rule considered as the original type or as the transformed type? If

it is a later case, how to interpret the above example?

- text/html attachment: attachment

**Next message:**Farid Mehrabi: "Making the new expression smart"**Previous message:**jim x: "Re: The issue about the wording "member of a class""

STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org