fork download
  1. #include <stdint.h>
  2. #include <string>
  3.  
  4. template <typename T> void function(uint8_t s, std::string str1, std::string str2, std::string str3){
  5. T var;
  6. switch (s){
  7. case 1:
  8. // var = classA;
  9. break;
  10. // case 2 ...
  11. // case 3 ...
  12. default:
  13. break;
  14. }
  15. }
  16.  
  17. int main() {
  18. std::string str = "01234567";
  19. function<int>(1, str, str, str);
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 2852KB
stdin
Standard input is empty
stdout

Standard output is empty