This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: can't parse qualified member names
On Jun 17, 1999, Vaclav Barta <vbar@comp.cz> wrote:
> Alexandre Oliva wrote:
>>
>> On Jun 17, 1999, Vaclav Barta <vbar@comp.cz> wrote:
>>
>> > int a = opt.COptions<int>::Get("a");
>>
>> Try:
>>
>> int a = opt.template COptions<int>::Get("a");
> I settled for
> int a = (opt.*&COptions<int>::Get)("a");
> which is equally confusing, but at least legal C++.
Re-reading the Standard revealed that the first alternative is legal
C++ even when the preceding expression is not template dependent; it
just happens to be *required* when the expression is template
dependent. So it's safe to use the `template' keyword before any
template-id.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists