|
-
April 6th, 2013, 06:45 PM
#6
Re: Constructors in a singleton
Now given that definition (whatever it is), does it make sense to have multiple copies?
Multiple copies of what? of the singleton? then no that is the whole reason I want to make all the constructors private.
So that the compiler won't make default constructors thus allowing people to make more then one copy of my singleton.
I want to control the creation of the singleton instances, so as to limit the number of instances to one! but the compiler will create a default constructor and a default copy constructor thus allowing someone to create as many copies as he wants. That is why I want to define private constructors so nobody would be able to create more then one instance of the singleton.
I am not sure tho whether I need a const one and a non-const one.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|