Codependent types with unordered_map
问题 Suppose that I want to keep a certain ordering between the entries of an unordered_map<int, int>. A memory efficient way to do that seems to be keeping a linked list between the entries of the map. Namely instead of having an unordered_map<int, int>, I will use an unordered_map<int, Node> where Node is defined as struct Node { int val; typename std::unordered_map<int, Node>::iterator up; }; Is this valid C++? Clang and gcc do not permit this saying Node is an incomplete type. See below for