How to declare a typedef that references itself?
问题 I have a Variant type which I want to use in something like a JSON parser. A type in JSON can include objects and arrays. These objects and arrays can contain members of their own type: typedef variant<int,float,bool,std::string> baseType; typedef std::vector<baseType> arrayType; // problem, can't have arrays of arrays typedef std::unordered_map<std::string,baseType> objType; // problem, can't have objects or arrays within objects. How do I create a "recursive" templated type? Something like: