Topic: conversion: ptr to member -> ptr to base of member (was: passing


Author: Ron Natalie <ron@spamcop.net>
Date: Mon, 30 Apr 2001 14:35:54 GMT
Raw View

Markus Schaaf wrote:
>
> "Ron Natalie" <ron@spamcop.net> wrote:
>
> > GACK.  The fact that a cast is necessary here is a big tipoff.  There's
> > no guarantee that this works.   Pointer to derived member is not necessarily
> > convertable to pointer to base member.
>
> That's a shame. It seems to me that this conversion is always
> possible. Am I missing something? Is this simply an omission
> in the standard or are there actually reasons to do so?

Not all derived members are part of the base class.  The reverse is true.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]