473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

ISO/IEC 14882 §3.2 #2 A virtual member function is used if it is not pure.

This is under the heading of "One Definition Rule" in the Standard, in a
paragraph explaining what it means for an object or non-overloaded function
to be 'used': "A virtual member function is used if it is not pure."

The subsequent paragraph says this:

"Every program shall contain exactly one definition of every non-inline
function or object that is used in that program; no diagnostic required."

Is that saying that a virtual member function must either be pure, or be
fully defined if a declaration for it appears in the translation unit,
regardless of whether it is actually called?

I believe the relevant wording is unchanged from this version:
http://www.kuzbass.ru:8086/docs/isocpp/basic.html

--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
Dec 7 '06 #1
2 1379
Steven T. Hatton wrote:
This is under the heading of "One Definition Rule" in the Standard,
in a paragraph explaining what it means for an object or
non-overloaded function to be 'used': "A virtual member function is
used if it is not pure."

The subsequent paragraph says this:

"Every program shall contain exactly one definition of every
non-inline function or object that is used in that program; no
diagnostic required."

Is that saying that a virtual member function must either be pure, or
be fully defined if a declaration for it appears in the translation
unit, regardless of whether it is actually called?

I believe the relevant wording is unchanged from this version:
http://www.kuzbass.ru:8086/docs/isocpp/basic.html
I think you can also find the "a virtual function shall be defined or
declared pure or both" somewhere in the document as well.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Dec 7 '06 #2
On Thu, 07 Dec 2006 16:37:39 -0500 in comp.lang.c++, "Steven T. Hatton"
<ch********@germania.supwrote,
>Is that saying that a virtual member function must either be pure, or be
fully defined if a declaration for it appears in the translation unit,
regardless of whether it is actually called?
Yes. By way of illustration, in some typical implementation a virtual
function that is not defined will result in a unresolved entry in the
vtable whether or not that vtable entry is ever used.

Dec 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: WittyGuy | last post by:
Hi all, Though I know the concepts of both abstract class & virtual function (like derived class pointer pointing to base class...then calling the function with the pointer...), what is the real...
11
by: santosh | last post by:
Hello, I was going through the Marshal Cline's C++ FAQ-Lite. I have a doubt regarding section 33.10. Here he is declaring a pure virtual destructor in the base class. And again defining...
2
by: Heinz Ketchup | last post by:
Hello, I'm looking to bounce ideas off of anyone, since mainly the idea of using Multiple Virtual Inheritance seems rather nutty. I chalk it up to my lack of C++ Experience. Here is my...
7
by: eric | last post by:
hello i'm confused by an example in the book "Effective C++ Third Edition" and would be grateful for some help. here's the code: class Person { public: Person(); virtual ~Person(); // see...
14
by: v4vijayakumar | last post by:
Why we need "virtual private member functions"? Why it is not an (compile time) error?
7
by: v4vijayakumar | last post by:
Is it possible to implement member object's virtual functions, in the containing class? If not, is it possible to simulate this behavior? ex: class test { protected: virtual void fun() = 0;...
7
by: sam_cit | last post by:
Hi Everyone, I wanted to know as to what is the exact difference between a virtual function and a pure virtual function? Thanks in advance!!!
17
by: Jess | last post by:
Hello, If I have a class that has virtual but non-pure declarations, like class A{ virtual void f(); }; Then is A still an abstract class? Do I have to have "virtual void f() = 0;"...
13
by: Mike -- Email Ignored | last post by:
Is a pure virtual function in allowed in a template base class? In any case, I have one working. Am I skating on thin ice? Thanks, Mike.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.