Menu

#2 slicing problem - new warning request

open
nobody
None
5
2007-05-11
2007-05-11
Anonymous
No

Roman, please add warning for next situation:

struct base{...}; //does not contain virtual function

struct derived : base { .. }; //same as above

If I call a Python function and pass instance of derived class as base, than in Python I've got instance of base class and not a derived - slicing. It could be nice to get a warning in such case.

Thanks

Discussion


Log in to post a comment.