Reputation: 9363
I am curious to know how an auto_ptr is implemented in c++. And i tried to find out where the source of it is located in ubuntu 10.04. I could only find the .h file but couldn't find its implementation. where can i find it?
Upvotes: 4
Views: 1033
Reputation: 48682
It is a template class, so the details are exposed in the header file: take a look.
Upvotes: 0
Reputation: 76775
The auto_ptr
is a template, and the whole code is most likely in the header file.
You can check on libstdc++ 4.4 implementation here.
Upvotes: 4
Reputation: 57046
The .h file is almost certainly its implementation. auto_ptr
is a template. Since template implementations need to be included in full, they're normally in the .h files.
Upvotes: 7