Suppose I have something like:
template <class T>
void do_something(T t){
pass_it_somewhere(t);
t->do_something();
}
Now it would be useful that T is allowed to be a pointer- or a non-pointer type. Function do_something(...) can basically handle pointers and non-pointers, except for the t->do_something(). For pointers, I would need a -> and for non-pointers, I would need a . to access members.
Is there a way to make T accept pointers and non-pointers?