Re: Template conversion and default copy constructor
not to copy constructors, whose signature must be
X ( X [const] [volatile] & )
Please read 12.8/3 again. It also says that a member function template
is
never instantiated to perform the copy of a class object to an object of
its class type, thus refering to copy constructors.
In your next reading of 12.8/3, please pay close attention to the example
that follows the explanation:
[12.8/3]
A declaration of a constructor for a class X is ill-formed if its first
parameter is of type (optionally cvqualified) X and either there are no
other parameters or else all other parameters have default arguments. A
member function template is never instantiated to perform the copy of a
class object to an object of its class type. [Example:
struct S {
template<typename T> S(T);
};
S f();
void g() {
S a( f() ); // does not instantiate member template
}
?end example]
I guess it is pretty clear now, what the member template instantiation
issue
is about: the would-be-illformed-when-instantiated template is not
instantiated.
I think you are right and I was wrong. I read the second sentence of 12.8/3
out of context, but now I am convinced that it only refers to the ill-formed
constructor.
--
Matthias Hofmann
Anvil-Soft, CEO
http://www.anvil-soft.com - The Creators of Toilet Tycoon
http://www.anvil-soft.de - Die Macher des Klomanagers
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]