| 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
.
|
|
|
|

|
Related Articles |
|
|