I know you can definitely have a reference variable in a class, but is there any more "elegant" way to do this than to have a placeholder object? This is my current code (I don't like how this is being done):
Object placeholder = Object();
class MyClass {
private:
Object& variable = placeholder;
}
EDIT: Reference variables apparently cannot be reassigned during runtime so my example doesn't even work. I would, however, still like to know how to include reference variables in my classes.