I'm making kind of a funky linked-list based data-structure where every element is associated to a unique heap-allocated internal iterator that points back to it (and external iterators point to those respectively). The idea is to have iterators which aren't invalidated when their element gets removed, but instead find themselves pointing to l.end()
In any case, I'm getting a lot of errors I don't understand. Here's a class that won't compile, but I don't understand why.
template<class T>
class pointer_node {
public:
pointer_node(const T& t) :
t(t), p_iter() {
}
pointer_node(T&& t) :
t(move(t)), p_iter() {
}
private:
T t;
std::shared_ptr<const std::list<pointer_node<T>>::iterator> p_iter;
};
The error I get is:
../src/pointer_list.h:28:24: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] ../src/pointer_list.h:28:60: error: template argument 1 is invalid
Can someone explain this error?