Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: a question about singleton/private destructor

Reply
Thread Tools

Re: a question about singleton/private destructor

 
 
Evan
Guest
Posts: n/a
 
      07-06-2003
"jack" <(E-Mail Removed)> wrote in message news:<be2tdl$o87$(E-Mail Removed)>...
> The following code is from Thinking in C++.
>
> Q1:
> If I declare a private destructor then it
> won't compile (I'm using Microsoft visual c++ 6.0).
> But I read somewhere that destructors can
> be private in a singleton. What's going on?


(Background) There was a thread on singletons just a little while ago.
I gave an option for the implementation one where Instance() returned
a pointer and the class had a private destructor.

Anyway, someone replied that VC++6 flags a private dtor as an error
and won't compile. Anyway, it's a compiler bug.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie -- smart pointer destructor called without destructor everbeing called Jimmy Hartzell C++ 2 05-20-2008 02:20 AM
newbie -- smart pointer destructor called without destructor everbeing called Jimmy Hartzell C++ 0 05-19-2008 07:05 PM
compiler generated destructor vs class implemented destructor arun C++ 2 06-13-2006 05:43 AM
Explicit destructor calls from inside base class destructor frs C++ 20 09-21-2005 09:22 AM
Re: a question about singleton/private destructor jack C++ 0 07-05-2003 04:34 PM



Advertisments