473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Templates: Members Vs. non-members

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
3 1270
"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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: franky.backeljauw | last post by:
Hello, I have a problem with using a copy constructor to convert an object of a templated class to object of another templated class. Let me first include the code (my question is below): ...
7
by: Senthilraja | last post by:
I have the following program using templates. Someone please let me know the syntax to be used for defining the member functions push, pop etc. as non-inline functions. #include <iostream>...
5
by: Ray Gardener | last post by:
Would templates be necessary if C++ had all numeric types inherit from a base "number" class and had all types inherit from a base "object" class? (Sorry if this has already been discussed to...
1
by: Markus Seeger | last post by:
Hi, I'm writing a commandline argument parser that can handle switches by using some techniques similar to the Qt slot mechanism. example: // inheritance method (what I'm trying at the...
7
by: fabio de francesco | last post by:
Hello, I'm just joking with the Subject, but I really don't know how to make a synthesis of two questions about some code I'm trying to write. In the following I post this little code, with...
1
by: Bo Xu | last post by:
Object of Combination By Bo Xu Introduction A combination of n things, taken s at a time, often referred as an s-combination out of n, is a way to select a subset of size s from a given set of...
3
by: Ruben Campos | last post by:
I've found a problem with types defined inside a template. With a non-template class, I can write the following: // MyClass.hpp class MyClass { // ... typedef unsigned int MyType; MyType...
25
by: Ted | last post by:
I'm putting the posts that follow here (hopefully they will follow here!) because they were rejected in comp.lang.c++.moderated. It behooves anyone reading them to first read the the thread of the...
4
by: aaragon | last post by:
Hi everyone, I was unable to find out why my code is not compiling. I have a template class and I'm trying to write the operator<< for standard output. Does anyone know why this is not right?...
3
by: Szabolcs | last post by:
Consider the attached example. When I try to compile it (with g++ 4.1.2), I get the error message error: no matching function for call to 'fun(A<int>&)' However, if I do not use templates, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.