Can`t I perform typedef inside the class?
#include <vector>
using namespace std;
class List {
public:
typedef int Data;
class iterator;
pair<iterator,bool> insert(const Data nodeId); //<-error
private:
class Node {
typedef vector<NodeId> DepList;//<-error
};
}
I get an error missing type specifier - int assumed. Note: C++ does not support default-int
You can.
I guess the error is on the line with the pair. Have you included the right header:
Also, if you don’t have
using namespace std;orusgin std::pair;, you need to writestd::pair, instead of justpair.P.S. Please, don’t use
using namespace std;, especially header files.EDIT Looking at your edit, you need
#include <vector>, too.EDIT2: You haven’t defined
NodeId, but you have used it for thetypedef