I've gone through the changes.
1. To fix the crash, you need to swap the order of definitions of YamlRootNodeReader._eventHandler and YamlRootNodeReader._parser.
2. I don't like the name alias(). I think a better name would be .clone() or .baseClone()
3. Can you explain the point of this function? Why is it better for the base class to have a clone function, instead of derived class to have a function that returns the base class?
4. I can't measure any performance difference to how it was before. There's more .alias calls now, where before there was nothing (with implicit copying).
Yup, I already push this change for this bug.
I do not use `.clone()` as this still would refer to same node in yaml memory,
I would assume opposite, that if I clone object then values would be independent new node, but they are not.
`YamlNode*` work more like `std::ref`. Overall I would prefer drop this function and use `YAML::YamlNodeWriter&`
but this conflict with `reader["foo"]` as this return value and can't use references.
Another thing to consider was that implicit copy constructor was broken, if you copy "indexed reader", then game would crash
as it would copy pointer to new object without clearing old pointer. Another thing was, should copy copy index too? How much it will cost?
Do we expect this cost? Because of this ".alias()" is explicit light weigh copy and I ban all implicit operations.
I would make it inline function, but I tried follow your style in this file where you separate implantation of every function you can.