This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: member-template bug in egcs


Michael A Benzinger writes:

> If you refer to Bjarne Stroustrup's
> book "The C++ Programming Language, Third Edition" on page 347 you will
> find the following example in section 13.6.2

if you're quoting the example correctly, I'm pretty sure this template
constructor has no purpose at all, since it is not a copy-constructor
(no template constructor is), and one specialization of class complex
does not have access to fields `re' and `im' of any other
specialization thereof.

> In other words, you can construct a complex<T1> from a complex<T2> if and
> only if you can initialize a T1 by a T2.  That seems reasonable."

It really does, but, unless I've missed some important part of the
standard, a specialization of a template class does not implicitly
gain priviledged access to another specialization of the same template
class.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]