0
아래와 같이 Null이라는 템플릿 기반 클래스를 작성하려고합니다. 나는 다른 방법을 시험하고 그것을 밖으로 작동하지 않을 수템플릿 화 된 매개 변수를 사용하는 C++ 템플릿 전문화
template <class Type>
class Null;
template <>
class Null<std::string> {
public:
Null() {}
operator std::string() const {
return std::string();
}
};
지금까지 문자열
을 위해 좋은 작동하지만 나는
template<> class Null<boost::shared_ptr<T>>
{
public:
NUll(){}
operator boost::shared_ptr<T>() const
{
return boost::shared_ptr<T>();
}
};
뭔가를 쓰고 싶어하지만 컴파일되지 않습니다. 어떻게해야할까요? 전문화 템플릿 매개 변수를 필요로