Is this a good use case for std::any? Are there any other options I should be considering? I assume that the user could instead inherit from my class but this does seem overkill to simply store extra data.
One problem is that I had wanted to save the data in the class to an XML file. I assume that it won't be possible to save the std::any variable to an XML file.
This isn't really a good use for std::any. Handling their custom data will be very difficult. Is it a string? Is it a number? Is it a bool? You don't know, and it's very hard to see how it would be helpful to the program.
You can always do this, but it'll be a pain, and you can't predict how the user will want this information used to create logical functions for it.