there is no way to delete something that isn't a pointer value
Well this could be what he's after, but delete on a stack based object has to be undefined behaviour I think.
Code:
class X
{
public:
operator X*()
{
returnthis;
}
};
int main()
{
X x;
delete x;
}
PS:- How comes copy/paste from my msvc9 express ruins all indentation. Ive set to use spaces instead of tabs like on all previous versions but my code never cut/pastes properly??
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Like in the typedef example demonstrated by Paul, the invocation of scalar/vector operator delete on a null pointer is guaranteed to be a logical no-op.
Ah yes, I think your idea "works" best.
Now, hopefully Gorbo can just submit this and move on to more useful things.
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar
Ok based on what laserlight and Plasmator wrote i made something similar to the requirements so thanks everyone and especially laserlight and Plasmator
Bookmarks