Today, we are going to talk about an object. Without further ado, let’s dive deeper!
Object Lifetime
by Ilya Doroshenko
From the article:
What is an object? According to the C++ standard, part 3.9.8 under the name of [basic.types]
An object type is a (possibly cv-qualified) type that is not a function type, not a reference type, and not a void type.Now is
int i
an object? Yes.Is
void* p
an object? Still yes, because pointers are types themselves, they are not references.As we said, references are not types, but what if we declare something like
struct S{ int& ref;};
would that be an object type?
Add a Comment
Comments are closed.