Jim Helman (jim++at++liberate.com)
Wed, 20 Oct 1999 10:21:01 -0800
If you overload the new operator on a per-class basis, that new
operator could signal the constructor, e.g. by setting a data member
in the class.
Distinguishing the latter two is trickier. I suppose you could have
the constructor compare "this" to the address of a stack variable to
see if it looks like a stack address.
I've seen worse hacks.
-jim
Jim Helman
jim++at++liberate.com
650.701.4638
On Mon, 11 Oct 1999 "Dirk Scheffter" wrote:
> Hi there,
>
> it's rather off-topic but I need it in my pfApp...
>
> If a constructor of a C++ class is executed: Is it possible to
> recognize how it was created? (I mean either statically or
> dynamically using new?)
>
> Would it help to overload operator new?
>
> All help is appreciated?
>
> Greetings,
> Dirk.
This archive was generated by hypermail 2.0b2 on Wed Oct 20 1999 - 11:22:07 PDT