language: C++ 4.7.2 (gcc-4.7.2)
date: 356 days 14 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdint.h>
#include <string>
 
template <typename T> void function(uint8_t s, std::string str1, std::string str2, std::string str3){
        T var;
        switch (s){
            case 1:
                // var = classA;
                break;
            // case 2 ...
            // case 3 ...
            default:
                break;
        }
}
 
int main() {
        std::string str = "01234567";
        function<int>(1, str, str, str);
 
        return 0;
}