fork(2) download
  1. #include <cstddef>
  2. #include <type_traits>
  3. #include <iostream>
  4.  
  5. template<class T, std::size_t sz>
  6. inline void reset(T(&x)[sz] )
  7. {
  8. std::cout << "array\n";
  9. }
  10.  
  11. template<class T>
  12. inline void reset(T *const &x)
  13. {
  14. std::cout << "pointer\n";
  15. }
  16.  
  17. template<class T>
  18. inline void reset(T&x)
  19. {
  20. std::cout << "reference\n";
  21. }
  22.  
  23. int main(int argc, const char* argv[], const char* envp[])
  24. {
  25. int nRetCode = 0;
  26.  
  27. char mass[10];
  28. char *pmass=mass;
  29.  
  30.  
  31. reset(mass);
  32. reset(pmass);
  33. reset(nRetCode);
  34. return nRetCode;
  35. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
array
reference
reference