Files
test/testConstructorCall/testConstructorCall.cpp
2012-12-06 21:43:03 +04:00

53 lines
651 B
C++

// testConstructorCall.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
class a
{
public:
a()
{
printf( "a\n" );
}
~a()
{
printf( "~a\n" );
}
int f()
{
return 0;
}
void operator delete ( void* p )
{
printf( "operator delete()\n" );
}
};
int _tmain(int argc, _TCHAR* argv[])
{
/*
a o;
// o.a( 0 );
o.~a();
o.f();
reinterpret_cast<a*>(0)->a::a();
*/
a* p1 = new a();
delete p1;
a* p2 = new a();
a::operator delete( p2 );
return 0;
}