D
Dylan
thanks
thanks
The same as between "a humen" and "the Dylan".
thanks
Dave O'Hearn said:What's the difference between "int" and "5"?
The question is rather vague. I don't know if it has an answer.
Philosophers have debated this stuff for thousands of years and show no
sign of stopping soon.
When inheritence comes in, it is important not to confuse the different
relationships. The type-instance relationship is not the same as the
base-derived relationship. Sometimes people will get sloppy and use the
phrase "is a" to describe all these relationships, like 'file' is an
fstream, fstream is an ifstream, etc. They are two different things.
--
Dave O'Hearn
Howard said:That's a rather confusing analogy. The "is a" relationship described public
inheritance, only. What this has to do with types and objects is, well,
nothing as far as I can see...?
Howard said:I see no confusion (or vagueness) here at all. An object is an
instance of a type. A type is a description (a declaration), which
follows very cleary defined rules in the C++ language. There are
built-in types and user-defined types. Since this question is asked
in the C++ language newsgoup, it seems pretty clear that these are
the definitions asked for.
No offense intended, Dave, but I think you're just going to confuse
the newbie here. Philosophy and C++ don't mix very well, in my
opinion.
jeffc said:Agreed. "Is a" makes sense in both contexts, even though it
means 2 different things.
Paavo Helde said:An object takes up space in computer memory at runtime, a type does not.
hth
Paavo
Howard said:I don't think that's a good description, or even accurate. Computer memory
is doled out by the operating system, and may be largely out of the control
of the code as to exactly when and where it is allocated.
Agree.
But, regardless of the memory model used, what about member functions and
static member data? Both of those exist independent of instances of a class
(i.e., objects), since they are shared by all instances. So simply
declaring a class or struct type may result in memory allocation for those
members, separate from any instanciated objects of that type.
Dave O'Hearn said:The FAQ has a whole section on confusions that arise from using "is a"
to describe the derived-base relationship.
http://www.parashift.com/c++-faq-lite/proper-inheritance.html
The FAQ recommends "is substituable for", and describes it in terms of
contracts.
Jonathan Mcdougall said:Who said that?
Jonathan Mcdougall said:Who said that?
jeffc said:Who said what?
What he just said?
Or that static class data members take
space?
Dylan said:What's the difference between an object and a type?
Howard said:I don't think that's a good description, or even accurate. Computer
memory is doled out by the operating system, and may be largely out
of the control of the code as to exactly when and where it is
allocated.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.