There is the following simplified data structure:
Object1.h
template class Object1 { private: T a1; T a2; public: T g
You can use this:
template class Object, class T> void func1(Object &o1, Object &o2) { T x = o1.getA1(); }
Working example at http://www.ideone.com/t8KON .
Btw. if you use pointers as parameters, you have to use -> operator to call methods.
->