#include <vcl.h>
#pragma hdrstop
#include "类模板完全特化.cpp"
#include "Unit1.h"
// ---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
// ---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) {
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender) {
char s1[] = "abc";
char s2[] = "abc";
compare<int>c1; // 泛型对象
compare<char*>c2; // 特化对象
UnicodeString b1 = "0";
if (c1.IsEqual(12, 10)) {
b1 = "1";
}
UnicodeString b2 = "0";
if (c2.IsEqual(s1, s2)) {
b2 = "1";
}
Memo1->Text="类模板完全特化 C++ Builder演示";
Memo1->Lines->Add("数字比较结果:");
Memo1->Lines->Add(b1);
Memo1->Lines->Add("字符数组比较结果:");
Memo1->Lines->Add(b2);
}
// ---------------------------------------------------------------------------