From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: Nathan Myers <ncm@cygnus.com>
Cc: egcs@cygnus.com
Subject: Re: explicit specialization in non-namespace scope
Date: Tue, 22 Sep 1998 06:35:00 -0000 [thread overview]
Message-ID: <org1dk8m82.fsf@araguaia.dcc.unicamp.br> (raw)
In-Reply-To: <3606BFC2.D2A647E1@cygnus.com>
Nathan Myers <ncm@cygnus.com> writes:
>> > An explicit specialization of a member
>> > function, member class or static data member of a class template
>> > shall be declared in the namespace of which the class template
>> > is a member. */
> It's still not clear that the above text applies to the case mentioned.
> "In the namespace of which the enclosing class is a member" is satisified
> both outside and inside the class. When it means to say "not in a class
> or in a block", it says "at namespace scope" or sometimes "in namespace
> scope"
> Anyhow, all is not lost. You can specialize this member anyway,
> even in egcs with bug added, just not as cleanly as you wanted:
> struct A {
> template <int I> inline int factorial();
> };
> template <> inline int A::f<0>() { return 1; }
> template <int I> inline void A::f<I>() { return f<I-1>() * I; }
Unfortunately, this won't work if A is a template class, because,
AFAIK, in order to specialize A<...>::factorial<I>, A<...> must be
fully specialized.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
next prev parent reply other threads:[~1998-09-22 6:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.GSO.3.96.980921144445.7109I-100000.cygnus.egcs@lystra.lysator.liu.se>
1998-09-21 19:37 ` Nathan Myers
1998-09-22 6:35 ` Alexandre Oliva [this message]
1998-09-22 9:00 ` Mark Mitchell
[not found] ` <199809220757.AAA30938.cygnus.egcs@smtp.earthlink.net>
1998-09-22 19:59 ` Nathan Myers
1998-09-23 8:43 ` Matthias Mueller
1998-09-28 16:32 ` Mark Mitchell
[not found] ` <199809282301.QAA19439.cygnus.egcs@smtp.earthlink.net>
1998-09-29 14:32 ` Nathan Myers
[not found] ` <org1dk8m82.fsf.cygnus.egcs@araguaia.dcc.unicamp.br>
1998-09-22 19:41 ` Nathan Myers
1998-09-21 7:32 Oskar Enoksson
-- strict thread matches above, loose matches on Subject: below --
1998-09-17 9:59 Oskar Enoksson
1998-09-17 11:14 ` Alexandre Oliva
[not found] ` <orvhmmk52m.fsf.cygnus.egcs@tiete.dcc.unicamp.br>
1998-09-18 22:10 ` Nathan Myers
1998-09-19 12:03 ` Mark Mitchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=org1dk8m82.fsf@araguaia.dcc.unicamp.br \
--to=oliva@dcc.unicamp.br \
--cc=egcs@cygnus.com \
--cc=ncm@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).