Given a class like this:
class C {
T obj;
T getObject() {
return obj;
}
}
Can i prevent the caller making references or pointers, something like this:
int main() {
C c;
// don't allow this:
T &mainObj = c.getObject();
T *mainObj = &c.getObject();
// only this:
T mainObj = c.getObject();
}
So in other words I only want to allow copies of the object (multi-threading pupose).