//test.h
#pragma once
#include <iostream>
#include <vector>
#include <string>
#include <conio.h>
#include <atlstr.h>//CString
using namespace std;
template <class typeIP,class typePort>
class CTest
{
public:
CTest(void){};
~CTest(void){};
private:
vector<typeIP> ip;
vector<typePort> port;
};
//t1.cpp
#include <iostream>
#include <vector>
#include <string>
#include <conio.h>
#include <atlstr.h>//CString
#include "h.h"
#include "Test.h"
using namespace std;
template <typename type1> void Print(vector<type1> &str);
template <typename type2> void Print(vector<type2> &);
void main()
{
vector<string> v_str;
v_str.push_back("aa");
v_str.push_back("bb");
v_str.push_back("cc");
Print(v_str);
vector<int> v_int;
v_int.push_back(11);
v_int.push_back(22);
v_int.push_back(33);
Print(v_int);
CTest<string,int> myClass;
getch();
}
template <typename type3> inline void Print(vector<type3> &str)
{
vector<type3>::iterator vit_p;
for (vit_p = str.begin(); vit_p!=str.end(); vit_p++)
{
cout<<(*vit_p)<<" ";
}
cout<<endl;
}