| 1 | #include <string> |
| 2 | |
| 3 | /** |
| 4 | * @brief a function with one template arguments |
| 5 | * |
| 6 | * @tparam T this is the template parameter |
| 7 | * |
| 8 | * @param arg1 argument of type T |
| 9 | * |
| 10 | * @return return value of type T |
| 11 | */ |
| 12 | template <typename T> |
| 13 | T function1(T arg1) |
| 14 | {} |
| 15 | |
| 16 | |
| 17 | /** |
| 18 | * @brief a function with one template argument specialized for `std::string` |
| 19 | * |
| 20 | * @param arg1 argument of type `std::string` |
| 21 | * |
| 22 | * @return return value of type `std::string` |
| 23 | */ |
| 24 | template <> |
| 25 | std::string function1<std::string>(std::string arg1) |
| 26 | {} |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * @brief a function with three template arguments |
| 31 | * |
| 32 | * @tparam T this is the first template parameter |
| 33 | * @tparam U this is the second template parameter |
| 34 | * @tparam N this is the third template parameter, it is a non-type parameter |
| 35 | * |
| 36 | * @param arg1 first argument of type T |
| 37 | * @param arg2 second argument of type U |
| 38 | * |
| 39 | * @return return value of type T |
| 40 | */ |
| 41 | template <typename T, typename U, int N> |
| 42 | T function2(T arg1, U arg2) |
| 43 | {} |