09/03/12 19:50:28 1+6JKHL2
#include <stdio.h>
class Object;
class Object{ public: virtual void Insert( Object* object ) = 0; };
class Penis : public Object{ public: virtual void Insert( Object* object ); };
class Vagina : public Object{ public: virtual void Insert( Object* object ); };
void Penis::Insert( Object *object ) {
if( object == Penis ) // 型判定
printf( "OMG!!\n" );
}
void Vagina::Insert( Object *object ){
if( object == Penis ) // 型判定
printf( "YES!!\n" );
}
型判定の方法忘れた