document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <array>
  2.  
  3. using namespace std;
  4.  
  5. void test1 (array<int,10>);
  6.  
  7. template <size_t N>
  8. void test2 (array<int,N>);
  9.  
  10. // arrayのsizeはintではなくsize_t
  11. // template <int N>
  12. // void test2 (array<int,N>);
  13.  
  14. void test(void)
  15. {
  16.     array<int,10> xs {1,2,3,4,5,6,7,8,9,0};    
  17.     int ys[] {1,2,3,4,5,6,7,8,9,0};
  18.    
  19.     test1 (xs);
  20.  
  21. // ダメなんだよね...
  22. //    test1 (ys);
  23.  
  24.     test2(xs);
  25.  
  26. // ダメなんだよね...
  27. //    test2(ys);
  28. }
');