You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

08-template-recursive-args.cc 317 B

12345678910111213141516
  1. #include <iostream>
  2. template<typename T>
  3. void my_printf(T value) {
  4. std::cout << value << std::endl;
  5. }
  6. template<typename T, typename... Ts>
  7. void my_printf(T value, Ts... args) {
  8. std::cout << value << std::endl;
  9. my_printf(args...);
  10. }
  11. int main() {
  12. my_printf(1, 2, "San Francisco", 1.1);
  13. return 0;
  14. }