About 20 years ago I read a paper, I think it was a C++ retrospective by Stroustrup talking about the justification for C++ templates.
He actually cited this use case, of a structure that has list or tree nodes inline with the data type, as a strength of the model.