Given the following situation:
template <typename T>
class Whatever
{
public:
Whatever(T &&t): _t(std::move(t)) { }
private:
T _t;
};
When Tis a pointer type, I need to check the Targ constructor to see if it -1(don't ask) and change it to nullptrbefore assigning it _t.
In other words , I need to overload this constructor for pointer types.
Does anyone know if this is possible?
Note. Even if I partially specialize the class on pointer types, I would like this class to inherit from the class itself, if possible (since the behavior of both classes is identical, except for this), but I don’t know, it is possible. Any help would be greatly appreciated. Thanks.