What is the best way to make a nested list in C++?

For those who know Python, the best way to explain what I want is by analogy:

[1, [2, 3], 4, [5, [6]], 7]

Obviously, I can implement my own class (template) to do this, but if the standard library has already invented this wheel, I want to avoid re-inventing it (or at least, avoid putting my half-baked re-invented version in my project).

For your amusement (not to be taken overly seriously):


Read more here: https://stackoverflow.com/questions/68464225/what-is-the-best-way-to-make-a-nested-list-in-c

Content Attribution

This content was originally published by allyourcode at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: