Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > [Q]:Creating objects _only_ by new ?

Reply
Thread Tools

[Q]:Creating objects _only_ by new ?

 
 
42Bastian Schick
Guest
Posts: n/a
 
      06-19-2008
Hi,

I'd like to prevent classes from beeing instaniated on the stack or
static, means only by new().
The reason: The class describes a process and the attributs must not
be on the stack of the creating process.
--
42Bastian
Do not email to http://www.velocityreviews.com/forums/(E-Mail Removed), it's a spam-only account
Use <same-name>@monlynx.de instead !
 
Reply With Quote
 
 
 
 
Fei Liu
Guest
Posts: n/a
 
      06-19-2008
42Bastian Schick wrote:
> Hi,
>
> I'd like to prevent classes from beeing instaniated on the stack or
> static, means only by new().
> The reason: The class describes a process and the attributs must not
> be on the stack of the creating process.

make the class destructors protected or private. check heap only class.

F
 
Reply With Quote
 
 
 
 
42Bastian Schick
Guest
Posts: n/a
 
      06-19-2008
On Thu, 19 Jun 2008 09:53:12 -0400, Fei Liu <(E-Mail Removed)> wrote:

>42Bastian Schick wrote:
>> Hi,
>>
>> I'd like to prevent classes from beeing instaniated on the stack or
>> static, means only by new().
>> The reason: The class describes a process and the attributs must not
>> be on the stack of the creating process.

>make the class destructors protected or private. check heap only class.


Great. Thanks.

--
42Bastian
Do not email to (E-Mail Removed), it's a spam-only account
Use <same-name>@monlynx.de instead !
 
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
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
form objects into class objects =?Utf-8?B?c3RldmVuIHNjYWlmZQ==?= ASP .Net 1 07-06-2006 08:33 AM
Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'. Mike Larkin ASP .Net 1 05-23-2005 12:33 PM
Inheritance of objects within objects Simon Elliott C++ 2 12-10-2004 10:59 AM
objects of objects, vectors and sessions bigbinc Java 3 11-18-2003 09:26 AM



Advertisments