By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,389 Members | 1,881 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,389 IT Pros & Developers. It's quick & easy.

Templates: Members Vs. non-members

P: n/a
Hello all,

Are the rules for templated member functions different in any way than the
rules for templated non-member functions?

How about templated member classes Vs. templated non-member classes?

Thanks,
Dave
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Dave" <be***********@yahoo.com> wrote...
Are the rules for templated member functions different in any way than the
rules for templated non-member functions?
Rules? Different? I can't recall any, really.
How about templated member classes Vs. templated non-member classes?


Hmm... No.

Why do you ask? Have you run into a problem?

V
Jul 22 '05 #2

P: n/a

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:CRURc.120348$eM2.35007@attbi_s51...
"Dave" <be***********@yahoo.com> wrote...
Are the rules for templated member functions different in any way than the rules for templated non-member functions?


Rules? Different? I can't recall any, really.
How about templated member classes Vs. templated non-member classes?


Hmm... No.

Why do you ask? Have you run into a problem?

V


Nope. I'm just preparing a presentation and am checking multiple sources to
make sure I'm giving accurate information.
Jul 22 '05 #3

P: n/a
On Mon, 9 Aug 2004 16:04:31 -0700, "Dave" <be***********@yahoo.com>
wrote:
Hello all,

Are the rules for templated member functions different in any way than the
rules for templated non-member functions?
Well, of course, since the rules for member functions are different
from the rules for non-member functions, in terms of overloading,
constness, declarations and definitions, etc.
How about templated member classes Vs. templated non-member classes?


You can't specialize a member template of a class template without
fully specializing the class template, but I'm not sure you'd call
that a difference.

When specifying member templates that are dependent names, you need to
use "template" to disambiguate. e.g. to call a template member
function specialization "foo" of a dependently typed object t you need
to do this:

t.template foo<int>();

Tom
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.