Im trying to turn this piece of JSON into a C++ type using a neat little JSON parsing library I have created.
[
"a",
[
"b",
[
"c",
[
"d",
["... so on so forth"]
]
]
]
]
Currently, this is technically what the type would look like in C++, however this is obviously invalid as the typename cannot reference itself:
typename std::variant<std::string, std::vector<requirements_type>> requirements_type;
Is there any way to make an infinitely recurring typename that can handle this sort of structure?
As mentioned in 463035818_is_not_a_number's answer
Instead of using a
typenameI can use aclassthat references itself:I can recurse through this by using this simple method: