#include <iostream>
#include <array>
#include "StorageB.h"
using namespace std;
template<typename T>
class A
{
public:
A(const T& input)
{}
void doSomething()
{
cout << typeid(T).name() << "\n";
}
void test()
{}
};
// 특수화
// 사실상 다른클래스. a_char.test() 하면 안뜬다.
template<>
class A<char>
{
public:
A(const char & temp)
{}
void doSomething()
{
cout << "Char type specializaiton" << "\n";
}
};
int main()
{
A<int> a_int(1); // A a_int(1); C++17 이상에서는 컴파일 오류 발생 X
A<double> a_double(3.14);
A<char> a_char('a');
a_int.doSomething();
a_double.doSomething();
a_char.doSomething();
return 0;
}