I have the following code:
struct All {
All() {}
~All() {}
template <typename T>
static struct Item {
T var;
} item;
virtual void setVal() noexcept {}
};
template <typename T>
struct any : public All
{
public:
any() : All() {}
~any() {}
T value;
void setVal() noexcept override {
All::item<decltype(value)>.var = value; // Error appears here
}
};
And the following error:
undefined reference to
All:item<int>
I don't understand this error, because item is a static member variable template, and i have to specialize it...
Help me !