template question



 DEVELOP > c-Plus-Plus > template question

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 12 Dec 2007 08:35:16 AM
Object: template question
I have a class with a Instance method to make object as unique.
I have to do many classes as it where changes are very small (class
name and internal function call). I thinks to do this with templates.
My problem is the method Instance can be a problem because
instantiation template refer to itself object. How can do it with
template?I need to make several object where every object have his
instance.
My class structure:
class P
{
P();
void Instance();
void Get();
void Set();
}
Thanks.
.

User: "Victor Bazarov"

Title: Re: template question 12 Dec 2007 08:50:31 AM
wrote:

I have a class with a Instance method to make object as unique.
I have to do many classes as it where changes are very small (class
name and internal function call). I thinks to do this with templates.
My problem is the method Instance can be a problem because
instantiation template refer to itself object. How can do it with
template?I need to make several object where every object have his
instance.

My class structure:

class P
{

P();
void Instance();
void Get();
void Set();


}

What you might want to google for is "singleton implemenatation C++
template". This topic is brought up every now and then, and the
solutions most likely have already been found. Now all you need is
to found *them*. Search the archives for this newsgroup and for
'comp.lang.c++.moderated' as well.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER