Johannes said:
There are two interpretations of this:
- If the use of the name in a using declaration results in refering to the
specialization of a template conversion function, or results in an
overload set that includes such a specialization, the program is
ill-formed because a using-declaration cannot refer to such a function.
- To determine the meaning of the name used in a using declaration,
template conversion functions are ignored, because a using declaration
cannot refer to a specialization of it, nor (in c++03) to the template
itself.
I guess i'm too fast with pressing "send" with non-moderated groups
Here
is what i sent to comp.std.c++, which is more what i meant to write. Please
forgive my many follow-self-answers. I'm really a bloody usenet-
nonmoderated-groups starter:
##################################
I see two interpretations:
Option 1:
----------
- During determining the meaning of the name, argument deduction for
template conversion functions is not done and only template conversion
functions or non-specialization conversion functions are found:
struct A {
template<typename T> operator int(); // #1
template<typename T> operator T(); // #2
operator int(); // #3
};
struct B : A {
// only specifies the name of #1 and #3
using A:
perator int;
};
Option 2:
----------
- After determining the meaning of the name, if the name refers to a
template conversion function specialization, the program is ill-formed.
struct A {
template<typename T> operator int(); // #1
template<typename T> operator T(); // #2
operator int(); // #3
};
struct B : A {
// ill-formed, because it refers to a specialization of #2.
using A:
perator int;
};
------------------------
Subsequently, i found a note in 7.3.3/4 which indicates the first option is
taken:
"Since specializations of member templates for conversion functions are not
found by name lookup, they are not considered when a using-declaration
specifies a conversion function"
This says what the intent of the standard is, and sort of answers my
question i think. If anyone knows normative wording for it, i would still
like to read about it, though.