Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Address of ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 9313 of 10094
Post > Topic >>

Re: Address of pure virtual function -- is it legal?

by Greg Herlihy <greghe@[EMAIL PROTECTED] > Feb 26, 2008 at 12:44 PM

On Feb 25, 3:36 am, luigi.balla...@[EMAIL PROTECTED]
 wrote:
> On Feb 22, 3:29 pm, Amal <amal.paramb...@[EMAIL PROTECTED]
> wrote:
>
> >     Getting the address of a pure virtual function is valid in all
> > cases. Whenever the address of a virtual/pure virtual function is
> > taken the vtable is referred and correct address is retrieved.   Hence
> > it is always valid what you have done and it must be compatible across
> > any c++ compilers.
>
> Thank you.  May anybody point me to where this is stated in the
> standard?

I doubt that anyone will be able to provide such a citation - because
nowhere in the C++ Standard is there any language that states that a
member pointer to a pure virtual method is OK. But - and more
im****tantly - nowhere in the C++ Standard is there any language that
states that a member pointer to a pure virtual method is not OK.

The C++ Standard would have to prohibit member pointers to pure
virtual methods explicitly (just as the Standard does, for example,
with member pointers to static member functions) in order to make such
member pointers illegal. Otherwise, in the absence of any language to
that effect, member pointers to pure virtual methods must be legal -
and must behave no differently than any other kind of member pointer.

Greg


-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 1 Posts in Topic:
Re: Address of pure virtual function -- is it legal?
Greg Herlihy <greghe@[  2008-02-26 12:44:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 8:04:26 CDT 2008.