fork download
  1.  
  2. template<typename T>
  3. constexpr int int_n(T x){
  4. return 1;
  5. }
  6.  
  7. template<typename T, typename... m>
  8. constexpr int int_n(T x,m... hvost){
  9. return 1+int_n(hvost...);
  10. }
  11. constexpr int str_n( const char* s){
  12. int u=0;
  13. while(*s!=0){
  14. if (*s=='%') u++;
  15. s++;
  16. }
  17. return u;
  18. }
  19.  
  20.  
  21. int main(int argc, char** argv)
  22. {
  23.  
  24. {
  25. long long n=_rdtsc(),d;
  26. int sn=str_n("sdfgkjlhasdflkjhsdfjlhk;gdfsjkl%hdrfjklhsdfjkhlsdfgjkhsdfgljhkgdfsdfgjk%");
  27. d=_rdtsc()-n;
  28. printf("s: %d [%d]\n",sn,d);
  29. n=_rdtsc();
  30. int nn=int_n(213,123,12,"12312",nullptr,123412);
  31. d=_rdtsc()-n;
  32. printf("i: %d [%d]\n",nn,d);
  33. system("pause");
  34.  
  35. }
  36.  
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:25:26: error: ‘_rdtsc’ was not declared in this scope
       long long n=_rdtsc(),d;
                          ^
prog.cpp:27:7: error: ‘d’ was not declared in this scope
       d=_rdtsc()-n;
       ^
prog.cpp:28:34: error: ‘printf’ was not declared in this scope
       printf("s: %d  [%d]\n",sn,d);
                                  ^
prog.cpp:33:21: error: ‘system’ was not declared in this scope
       system("pause");
                     ^
stdout
Standard output is empty