473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

[Q]:Creating objects _only_ by new ?

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 ba*******@yahoo.com, it's a spam-only account :-)
Use <same-name>@monlynx.de instead !
Jun 27 '08 #1
2 932
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
Jun 27 '08 #2
On Thu, 19 Jun 2008 09:53:12 -0400, Fei Liu <fe*****@gmail.comwrote:
>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 ba*******@yahoo.com, it's a spam-only account :-)
Use <same-name>@monlynx.de instead !
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Fuzzyman | last post by:
Pythons internal 'pointers' system is certainly causing me a few headaches..... When I want to copy the contents of a variable I find it impossible to know whether I've copied the contents *or*...
3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
1
by: PATRICIA THOMPSON | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta...
15
by: shuisheng | last post by:
Dear All, Assume I have a class named Obj. class Obj { }; And a class named Shape which is derived from Obj. class Shape: public Obj
5
by: =?UTF-8?B?TWFydGluIFDDtnBwaW5n?= | last post by:
Hello, I´ve a general question about the visibility and modification of an object. I will try to explain it in my code, where I have the problem: DocumentList dList =...
10
by: datamonkey.ryan | last post by:
Howdy, a (possibly) quick question for anyone willing to listen. I have a question regarding lists and Classes; I have a class called "gazelle" with several attributes (color, position, etc.) and I...
15
by: mark.norgate | last post by:
Hello I want to create a reference to an object, so that changes to the referenced object are reflected in the other object. Like this: object o = 123; object p = o; o = 456;
7
by: Yen Kwoon | last post by:
Note: This problem is related to gcc but after some back and forth in group gnu.gcc.help it seems to have morph into more of a c++ specificiation question, hence the transplanting to this group. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.