Objects with representations

S

Stefan Ram

IIRC BS said that a move operation would »steal the
representation« of an object. I understand this, I can even
get the meaning of »representation« from it, but what
actually is the general meaning of »the representation of an
object« in C++ or OOP. Is there any definition of the term
»representation« somewhere?

For example, if I have an object of the class

class C
{ char * mybuffer; /* dynamically allocated in constructors */
int code;
... }

, a move operation would "steal" the buffer, but just copy
the code value. So, when it is said that the move steals the
representation, this suggests, that the buffer is part of
the representation but the int code is not, because the int
code is not stolen but just copied?

Do we already have a designation for those »parts« of an
object that reside outside of the actual struct of the
object (usually dynamically allocated), like the referent of
»mybuffer« above?

They even have a specific kind of lifetime. We already
know static lifetime, automatic lifetime, dynamic lifetime.
But this could be called »object-bound lifetime«, that is
(ignoring stealing), their lifetime (when implemented
correctly) is bound (limited) by the lifetime of the object.
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top