模板

#include <iostream>

using namespace std;

template<typename T1, typename T2>
class Test
{
public:
    T1 m_t1;
public:
    Test(T1 t1)
    {
        this->m_t1 = t1;
    }
};

int main(void)
{
    typedef Test<int, char> TEST;
    int a(100);
    TEST *pMyTest = new TEST(a);
    cout << pMyTest->m_t1 << endl;
    
    return 0;
}

 

posted @ 2018-09-14 14:47  c&z  阅读(94)  评论(0编辑  收藏  举报