I'm trying to extend a template to add a function for a specific type.
This is what I have now:
template<typename T> class Item {
public:
T value;
}
And I want to make it so Item<bool>
has a operator bool()
, like this:
template<> class Item<bool> : public Item<bool>{
public:
explicit operator bool() const {
return this->value; // error
}
}
However, I get an error saying class 'Item<bool>' has no member 'value'
.
What am I missing?