Advertisement
MasWag

array-test.cc

Sep 21st, 2014
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement