diff options
Diffstat (limited to 'examples/templ.cpp')
-rw-r--r-- | examples/templ.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/templ.cpp b/examples/templ.cpp new file mode 100644 index 0000000..9ed48fb --- /dev/null +++ b/examples/templ.cpp @@ -0,0 +1,35 @@ + +/*! A template class */ +template<class T,int i=100> class Test +{ + public: + Test(); + Test(const Test &); +}; + +/*! complete specialization */ +template<> class Test<void *,200> +{ + public: + Test(); +}; + +/*! A partial template specialization */ +template<class T> class Test<T *> : public Test<void *,200> +{ + public: + Test(); +}; + +/*! The constructor of the template class*/ +template<class T,int i> Test<T,i>::Test() {} + +/*! The copy constructor */ +template<class T,int i> Test<T,i>::Test(const Test &t) {} + +/*! The constructor of the partial specilization */ +template<class T> Test<T *>::Test() {} + +/*! The constructor of the specilization */ +template<> Test<void *,200>::Test() {} + |