2013/11/15 Steven Watanabe
AMDG
On 11/15/2013 05:50 AM, Antony Polukhin wrote:
But this error appears only when we mutate data ( https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelinessearch for "strict-aliasing rules")
...and can be arbitrarily broken by (unknown) future optimizations, with no recourse. We wouldn't have all the problems with strict aliasing that we do today if programmers 10 years ago hadn't made exactly the same argument that you are, now. (Sure, it's undefined behavior, but we know what the compiler actually does, so it's really okay...).
You're absolutely right. I've liked the idea of "make it in a way that user won't notice a difference but typeid issues will be solved" so much, that turned a blind eye to a hack with UB. This will be fixed (possibly code from v1.0 will be taken, which had no boost::type_info and contained type_index class that had a pointer to std::type_info). Do you have other ideas of what can be fixed/improved? -- Best regards, Antony Polukhin