That’s fine and is the typical way of doing it.
You will have to declare expensive_object_ as mutable
mutable QObject *expensive_object_;
mutable basically means “I know I’m in a const object, but modifying this won’t break const-ness.”
That’s fine and is the typical way of doing it.
You will have to declare expensive_object_ as mutable
mutable QObject *expensive_object_;
mutable basically means “I know I’m in a const object, but modifying this won’t break const-ness.”