[计算机科学经

Hpp types templatetypename t class promotiontt public

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 是在 class ,㆒種是在 class 之外且 namespace scope 之內 (譯註:global 之內(譯註:亦即 member templates) scope 也被視為㆒種 namespace scope): template <typename T> class List { public: template <typename T2> List (List<T2> const&); ... }; // ㆒個 namespace scope class template // ㆒個 member function template // (這是個建構式) C++ Templates - The Complete Guide 8 96 template <typename T> template <typename T2> List<T>::List (List<T2> const& b) { ... } template <typename T> int length (List<T> const&); class Collection { template <typename T> class Node { ... }; 基礎技術更深入(Fundamentals in Depth) // ㆒個定義於 class 外的 member function template // ㆒個 namespace scope function template // ㆒個定義於 class 內的 member class template template <typename T> class Handle; // 又㆒個 member class template,無定義 template <typename T> T* alloc() { ... } ... // ㆒個定義於 clas...
View Full Document

This note was uploaded on 08/25/2012 for the course EECS 101 taught by Professor Wre during the Fall '12 term at Beacon FL.

Ask a homework question - tutors are online