cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
template issue
template issue
Dec 17, 2012 at 10:53am UTC
sajis997
(109)
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
Dec 17, 2012 at 10:57am UTC
vlad from moscow
(6539)
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
Dec 17, 2012 at 10:58am UTC
Topic archived. No new replies allowed.