By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

dereferencing pointer to base

P: n/a
Vam
dereferencing a pointer to base always provides a base-class slice even if
the object pointed to was of a derived type, correct?
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Vam wrote:
dereferencing a pointer to base always provides a base-class slice even if
the object pointed to was of a derived type, correct?


Slicing occurs when a value is extracted. If dereferencing yields
a reference, then no, slicing does not happen. A reference can be
used polymorphically just as well as a pointer.

V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.