static_cast<IFoo*>(foop)->AddRef();
STATIC_CAST(IFoo*, foop)->AddRef();
main()	{		cout << ">>main()" << endl;		{			cout << endl << "### Test  1: will a |COM_auto_ptr| call |AddRef| on a pointer assigned into it?" << endl;			COM_auto_ptr<IFoo> foop( new IFoo );			cout << endl << "### Test  2: will a |COM_auto_ptr| |Release| its old pointer when a new one is assigned in?" << endl;			foop = new IFoo;				// [Shouldn't compile] Is it a compile time error to try to |AddRef| by hand?			//foop->AddRef();				// [Shouldn't compile] Is it a compile time error to try to |Release| be hand?			//foop->Release();			cout << endl << "### Test  3: can you |AddRef| if you must?" << endl;			static_cast<IFoo*>(foop)->AddRef();			cout << endl << "### Test  4: can you |Release| if you must?" << endl;			static_cast<IFoo*>(foop)->Release();			cout << endl << "### Test  5: will a |COM_auto_ptr| |Release| when it goes out of scope?" << endl;		}		{			cout << endl << "### Test  6: will a |COM_auto_ptr| call the correct destructor?" << endl;			COM_auto_ptr<IFoo> foop( new IBar );		}		{			cout << endl << "### Test  7: can you compare one |COM_auto_ptr| with another [!=]?" << endl;			COM_auto_ptr<IFoo> foo1p( new IFoo );				// [Shouldn't compile] Is it a compile time error to omit |func_[doesnt_]AddRef[s]|?			//AnIFooPtrPtrContext(&foo1p);				// [Shouldn't compile] Is it a compile time error to omit |func_[doesnt_]AddRef[s]|?			//AVoidPtrPtrContext(&foo1p);			COM_auto_ptr<IFoo> foo2p( new IFoo );			if ( foo1p != foo2p )				cout << "foo1p != foo2p" << endl;			else				cout << "foo1p == foo2p" << endl;			IFoo* raw_foo2p = foo2p.get();			cout << endl << "### Test  8: can you compare a |COM_auto_ptr| with a raw interface pointer [!=]?" << endl;			if ( foo1p.get() != raw_foo2p )				cout << "foo1p.get() != raw_foo2p" << endl;			else				cout << "foo1p.get() == raw_foo2p" << endl;			cout << endl << "### Test  9: can you assign one |COM_auto_ptr| into another?" << endl;			foo1p = foo2p;			cout << endl << "### Test 10: can you compare one |COM_auto_ptr| with another [==]?" << endl;			if ( foo1p == foo2p )				cout << "foo1p == foo2p" << endl;			else				cout << "foo1p != foo2p" << endl;			cout << endl << "### Test 11: can you compare a |COM_auto_ptr| with a raw interface pointer [==]?" << endl;			if ( raw_foo2p == foo2p.get() )				cout << "raw_foo2p == foo2p.get()" << endl;			else				cout << "raw_foo2p != foo2p.get()" << endl;			cout << endl << "### Test 12: bare pointer test?" << endl;			if ( foo1p )				cout << "foo1p is not NULL" << endl;			else				cout << "foo1p is NULL" << endl;			cout << endl << "### Test 13: numeric pointer test?" << endl;			if ( foo1p == 0 )				cout << "foo1p is NULL" << endl;			else				cout << "foo1p is not NULL" << endl;			cout << endl << "### Test 14: how about when two |COM_auto_ptr|s refering to the same object go out of scope?" << endl;		}		{			cout << endl << "### Test 15,16 ...setup..." << endl;			IFoo* raw_foo1p = new IFoo;			raw_foo1p->AddRef();			IFoo* raw_foo2p = new IFoo;			raw_foo2p->AddRef();			cout << endl << "### Test 15: what if I don't want to |AddRef| when I construct?" << endl;			COM_auto_ptr<IFoo> foo1p( dont_AddRef(raw_foo1p) );			//COM_auto_ptr<IFoo> foo1p = dont_AddRef(raw_foo1p);			cout << endl << "### Test 16: what if I don't want to |AddRef| when I assign in?" << endl;			COM_auto_ptr<IFoo> foo2p;			foo2p = dont_AddRef(raw_foo2p);		}		{			cout << endl << "### Test 17: basic parameter behavior?" << endl;			COM_auto_ptr<IFoo> foop;			CreateIFoo( func_AddRefs_t<IFoo>(foop) );		}		{			cout << endl << "### Test 18: basic parameter behavior, using the short form?" << endl;			COM_auto_ptr<IFoo> foop;			CreateIFoo( func_AddRefs(foop) );		}		{			cout << endl << "### Test 19: reference parameter behavior?" << endl;			COM_auto_ptr<IFoo> foop;			set_a_IFoo(&foop);			cout << endl << "### Test 20: return value behavior?" << endl;			foop = return_a_IFoo();		}		cout << endl << "### Test 21: will a static |COM_auto_ptr| |Release| before program termination?" << endl;		gFoop = new IFoo;				cout << "<<main()" << endl;		return 0;	}