Suppose I have something like:
template <class T> void do_something(T t){ pass_it_somewhere(t); t->do_something(); }
It would now be useful for T allow the type of pointer or non-pointer. The do_something(...) function can basically handle pointers and not pointers except t->do_something() . For pointers I will need -> and for non pointers, I will need . to access items.
Is there any way to make T accept pointers and pointers without pointers?
c ++ pointers c ++ 11 templates
Michael
source share