template issue

Hello forum,

Does the template type take care of the pointer type ? for example if i have a template class as follows:

1
2
3
4
5
template <typename T>
class kdtree
{

};


Will the above code also handle kdtree<int *> ?


Thanks
Sajjad
Yes, it will.

Consider for example standard template class std::vector. You can define

std::vector<int> v;

and

std::vector<int *> pv;
Last edited on
Topic archived. No new replies allowed.