| 1 | /** |
| 2 | * @brief a class with a template parameter |
| 3 | * |
| 4 | * @tparam T this is the template parameter |
| 5 | */ |
| 6 | template <typename T> |
| 7 | class templateclass |
| 8 | { |
| 9 | public: |
| 10 | |
| 11 | /// default constructor |
| 12 | templateclass() {} |
| 13 | |
| 14 | /** |
| 15 | * @brief constructor with template argument |
| 16 | * |
| 17 | * @param m the argument |
| 18 | */ |
| 19 | templateclass(T const & m) : member(m) {} |
| 20 | |
| 21 | /** |
| 22 | * @brief member accepting template argument and returning template argument |
| 23 | * |
| 24 | * @param t argument of type T |
| 25 | * @return returns value of type T |
| 26 | */ |
| 27 | T method(T const & t); |
| 28 | |
| 29 | private: |
| 30 | /// a member with templated type |
| 31 | T member; |
| 32 | }; |