AMDG On 11/15/2013 01:09 PM, Niall Douglas wrote:
1. I would be happy with the static upcast if no virtual function table were in play because it's single inheritance, and static_cast provides enough safeguards (e.g. erroring if the type's inheritance tree is unknown at the point of static_cast use). It's a very common pattern in C++ code and is used throughout (especially older parts of) Boost. It is sufficiently common that no future compiler could ever disable it or misoperate with it. I agree that could hinder significantly future C++ features, but that is not TypeIndex's problem because of so much preexisting usage. It's an established idiom, and that's that: in my opinion TypeIndex has the right to use established idioms if they are currently safe with all possible present compiler technologies as implied by the present C++ standard.
I don't agree that this is an idiom. I know that Boost.Move uses it, but I'm not aware of any other Boost library that does. Boost.Move is not nearly as problematic, because it only uses this in the fallback for C++03. It will eventually be phased out in C++11. In Christ, Steven Watanabe