|
[Sponsors] |
August 20, 2008, 08:30 |
After I destroy a fvMesh objec
|
#1 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
After I destroy a fvMesh object:
mesh.~fvMesh(); or mesh.fvMesh::~fvMesh(); I could still use mesh variable with no complains from the compiler?! Did I do something wrong? Thanks. |
|
August 20, 2008, 09:47 |
>After I destroy a fvMesh obje
|
#2 |
Guest
Posts: n/a
|
>After I destroy a fvMesh object:
>mesh.~fvMesh(); >or >mesh.fvMesh::~fvMesh(); I would never have thought of using the destructor function this way :-o Not the destructor function destroys an object, but when an object is destroyed, then the destructor is called. >I could still use mesh variable with no complains >from the compiler?! There are several objects with an empty destructor, so calling it has no effect. But generally its a very, very bad idea. >Did I do something wrong? Depends on your point of view. I suggest doing something right would be to learn C++. Nadine |
|
August 20, 2008, 11:19 |
"Note that explicit call of d
|
#3 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
[Stroustrup2000 p. 256] "Note that explicit call of destructors ... should be avoided wherever possible. Occasionally, they are essential." Thanks for your help.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Explicit filtering in LES | TJ | Main CFD Forum | 85 | November 30, 2016 05:22 |
implicit or explicit | laure | FLUENT | 2 | June 2, 2007 06:45 |
implicit vs explicit | pXYZ | Main CFD Forum | 2 | April 21, 2006 09:48 |
explicit formulations | Muhammad zubair | FLUENT | 1 | June 14, 2004 00:44 |
Coupled Explicit | Andrew Parker | FLUENT | 1 | October 12, 2001 07:18 |