template<typename T>
void funcTmp(T a, T b)
{
    cout << "this is yiban" << endl;
}


template<>
void funcTmp(const char* a, const char* b)
{
    cout << "this is char*" << endl;
}


template<typename T>
class CTem 
{
public:
    void func()
    {
        cout << "this is usural func" << endl;

    }
};

void CTem<char>::func()
{
    cout << "this is char func" << endl;
}

template<>
class CTem<int>
{
public:
    void func()
    {
        cout << "this is int func" << endl;

    }
};

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2021-10-09
  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2021-10-20
  • 2022-01-17
  • 2021-09-29
  • 2021-12-25
  • 2021-08-26
相关资源
相似解决方案