On 2009-02-09 16:02:10 -0500, "Denis Koroskin" <[email protected]> said:
The one case I could think of was the strategy pattern: no data is
added (including, no virtual functions) -- the only thing that's added
is a different implementation of an existing virtual function. In such
a situation, the slicing problem cannot happen.
Michel has posted (2 posts up) an example of a class that happen to
have no member fields at all (virtual methods only). And yet it still
suffers from slicing.
Indeed. But that's in C++. It could certainly be possible to make that
work differently in another language. I'm not sure it's worth it for D
though.
--
Michel Fortin
[email protected]
http://michelf.com/