initial check in
This commit is contained in:
52
testConstructorCall/testConstructorCall.cpp
Normal file
52
testConstructorCall/testConstructorCall.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user