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.
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.