
14 Feb
2010
14 Feb
'10
10:28 p.m.
Kim Barrett wrote:
However, it seems to me that there is a bug in the existing smart_cast implementation, in that it may incorrectly attempt to use static_cast in the case where U is a virtual_base_of T.
smart_cast predates the existence of is_virtual_base_of by about 9 years so I would expect this to be true.
I think the correct fix is to leave the existing derivation test in place, but augment it with the is_virtual_base_of test, i.e. mpl::or_ the existing test for cross-cast (T and U have no base/derived relationship) with the is_virtual_base_of test.
That would sound correct to me. Robert Ramey