Topic: Which object is object? - Clarification needed


Author: "E. Robert Tisdale" <E.Robert.Tisdale@jpl.nasa.gov>
Date: 31 Aug 2002 23:21:14 GMT
Raw View
Attila Feher wrote:

> C object: a named region of storage, with an associated type
> as opposite to temporary objects with no name
> (if I understood Kernighan correctly)
>
> OO object: instance of a class
>
> Now it is clear, that (non-temporary) OO objects _are_ C objects as well.
> What is not clear for me is that when I read the Standard
> (eg: the part in reinterpret_cast talking about pointers to objects)
> which meaning should I choose?
>
> Could you clarify?

In the context of any computer programming language

    an object is always a data object

that can be referenced as a single entity
even if the storage for that data object is scattered across memory
or distributed across different memory systems.

The terms type, class, category, kind, etc. are all synonyms
for types of objects.
The C struct keyword and the Pascal record keyword
are used to create "capsules" containing aggregations
of objects of existing types and introduce new types
into the program.  Most computer programming languages
distinguish between built-in types provided by the language definition
and user defined types provided by the programmer.

Unfortunately, the description of some computer programming languages
such as Java confuse objects with classes which are types of objects.
Part of the problem is that Java class definitions automatically instantiate

a [data] object which has the same name as the class
and class methods applied to the class are actually applied to this object.



---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]





Author: Andrey Tarasevich <andreytarasevich@hotmail.com>
Date: Fri, 30 Aug 2002 13:38:54 CST
Raw View
Attila Feher wrote:
> ...
> I was reading the Holy Standard today.  Thanx for asking, I am
> recovering well. :-)  However, while reading, I have got an message into
> my syslog: Warning: Ambiguous word "object". Possible candidates:
> C(terminology)::object, OO(terminology)::object.
>
> C object: a named region of storage, with an associated type as opposite
> to temporary objects with no name (if I understood Kernighan correctly)
>
> OO object: instance of a class
>
> Now it is clear, that (non-temporary) OO objects _are_ C objects as
> well.  What is not clear for me is that when I read the Standard (eg:
> the part in reinterpret_cast talking about pointers to objects) which
> meaning should I choose?
> ...

Choose C++ meaning, defined in 1.8/1. An 'object' is a region of
storage. There is no requirement for it to be named. Temporary objects
are objects. Variables of type 'int' are object too.

Best regards,
Andrey Tarasevich,
Brainbench C and C++ Programming MVP

---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]





Author: jpotter@falcon.lhup.edu (John Potter)
Date: Fri, 30 Aug 2002 21:30:06 CST
Raw View
On 30 Aug 2002 18:40:08 GMT, Andrey Tarasevich
<andreytarasevich@hotmail.com> wrote:

> Choose C++ meaning, defined in 1.8/1. An 'object' is a region of
> storage. There is no requirement for it to be named. Temporary objects
> are objects. Variables of type 'int' are object too.

Lvalues refer to objects; so variables are objects.  Fundamental
temporaries (rvalues) are not regions of storage, so are not objects.
Class temporaries (rvalues) must be regions of storage because members
can be called with a this pointer pointing to storage.

May the confusion continue. ;-)

John

---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]





Author: Attila Feher <Attila.Feher@lmf.ericsson.se>
Date: Fri, 30 Aug 2002 12:01:51 CST
Raw View
Hi All,

I was reading the Holy Standard today.  Thanx for asking, I am
recovering well. :-)  However, while reading, I have got an message into
my syslog: Warning: Ambiguous word "object". Possible candidates:
C(terminology)::object, OO(terminology)::object.

C object: a named region of storage, with an associated type as opposite
to temporary objects with no name (if I understood Kernighan correctly)

OO object: instance of a class

Now it is clear, that (non-temporary) OO objects _are_ C objects as
well.  What is not clear for me is that when I read the Standard (eg:
the part in reinterpret_cast talking about pointers to objects) which
meaning should I choose?

Could you clarify?

Attila

---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]





Author: "Victor Bazarov" <vAbazarov@dAnai.com>
Date: Fri, 30 Aug 2002 13:29:44 CST
Raw View
"Attila Feher" <Attila.Feher@lmf.ericsson.se> wrote...
> I was reading the Holy Standard today.  Thanx for asking, I am
> recovering well. :-)  However, while reading, I have got an message into
> my syslog: Warning: Ambiguous word "object". Possible candidates:
> C(terminology)::object, OO(terminology)::object.
> [..]
> Could you clarify?

See 1.8  "An object is a region of storage ..."

Victor
--
Please remove capital A's from my address when replying by mail


---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]