class TForm
{
} ;
// 把TFrm1 跟 TFrm2 相同的data跟function抽出來
class MyFormTemplate : public TForm
{
public :
// 相同的data
int i;
// 相同的function
void func( ) { ++ i; } ;
} ;
class TFrm1 : public MyFormTemplate
{
public :
int a;
void func1( ) ;
} ;
class TFrm2 : public MyFormTemplate
{
public :
int b;
void func2( ) ;
} ;
Y2xhc3MgVEZvcm0Kewp9OwogCi8vIOaKilRGcm0xIOi3nyBURnJtMiDnm7jlkIznmoRkYXRh6LefZnVuY3Rpb27mir3lh7rkvoYKY2xhc3MgTXlGb3JtVGVtcGxhdGUgOiBwdWJsaWMgVEZvcm0KewpwdWJsaWM6CiAgICAvLyDnm7jlkIznmoRkYXRhCiAgICBpbnQgaTsKICAgIC8vIOebuOWQjOeahGZ1bmN0aW9uCiAgICB2b2lkIGZ1bmMoKSB7ICsraTsgfTsKfTsKIApjbGFzcyBURnJtMSA6IHB1YmxpYyBNeUZvcm1UZW1wbGF0ZQp7CnB1YmxpYzoKICAgIGludCBhOwogICAgCiAgICB2b2lkIGZ1bmMxKCk7Cn07CiAKY2xhc3MgVEZybTIgOiBwdWJsaWMgTXlGb3JtVGVtcGxhdGUKewpwdWJsaWM6CiAgICBpbnQgYjsKICAgIAogICAgdm9pZCBmdW5jMigpOwp9Owo=