boost::spirit::hold_any memory corruption
问题 I have a large code base that can use boost::any or boost::spirit::hold_any (depending on a macro definition). hold_any seems to be compatible with boost::any (e.g. How to print boost::any to a stream? or Type erasure - Part IV) and faster (Why you shouldn’t use boost::any) but I'm experiencing several segmentation fault errors using hold_any (Boost v1.55 / 1.54 / 1.53). This is a minimal working example that exhibits the same problem as the original code: #include <iostream> #include <string