fork download
  1. #include <array>
  2.  
  3. using namespace std;
  4.  
  5. template <typename T, size_t N>
  6. struct YobaAr : array<T, N>
  7. {
  8. using array<T, N>::template array<T, N>;
  9. };
  10.  
  11. int main() {
  12. YobaAr<int, 3> test {1, 2, 3};
  13. for (int t : test)
  14. cout << t << endl;
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:8:21: error: expected unqualified-id before 'template'
  using array<T, N>::template array<T, N>;
                     ^
prog.cpp:8:21: error: expected ';' before 'template'
prog.cpp:8:30: error: expected '<'
  using array<T, N>::template array<T, N>;
                              ^
prog.cpp:8:30: error: 'array<T, N>' does not name a type
prog.cpp: In function 'int main()':
prog.cpp:12:30: error: no matching function for call to 'YobaAr<int, 3u>::YobaAr(<brace-enclosed initializer list>)'
  YobaAr<int, 3> test {1, 2, 3};
                              ^
prog.cpp:12:30: note: candidates are:
prog.cpp:6:8: note: YobaAr<int, 3u>::YobaAr()
 struct YobaAr : array<T, N>
        ^
prog.cpp:6:8: note:   candidate expects 0 arguments, 3 provided
prog.cpp:6:8: note: constexpr YobaAr<int, 3u>::YobaAr(const YobaAr<int, 3u>&)
prog.cpp:6:8: note:   candidate expects 1 argument, 3 provided
prog.cpp:6:8: note: constexpr YobaAr<int, 3u>::YobaAr(YobaAr<int, 3u>&&)
prog.cpp:6:8: note:   candidate expects 1 argument, 3 provided
prog.cpp:14:3: error: 'cout' was not declared in this scope
   cout << t << endl;
   ^
prog.cpp:14:16: error: 'endl' was not declared in this scope
   cout << t << endl;
                ^
stdout
Standard output is empty