ID 5941491
Пользователь Морозов Денис Витальевич
Время 17:46<< 28.12.2021 17:46 (24 д. 17:46) 17:48>>
Обработка 17:46 ... 17:46 (2,47 сек.)
Файл 5941491.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 3, осень 2021
Задача C: Initialize vector
Набор тестов
Ограничения Время: 1с Память: 4000Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:13:0:
initialize_vector.h: In function 'std::vector<_Tp> initialize_vector(T, int)':
initialize_vector.h:6:27: error: expected primary-expression before 'out'
     return std::vector<T> out(s, value);
                           ^~~
initialize_vector.h:6:27: error: expected ';' before 'out'
initialize_vector.h: At global scope:
initialize_vector.h:9:13: error: 'T' was not declared in this scope
 std::vector<T> initialize_vector(T value, int s, D... dims) {
             ^
initialize_vector.h:9:14: error: template argument 1 is invalid
 std::vector<T> initialize_vector(T value, int s, D... dims) {
              ^
initialize_vector.h:9:14: error: template argument 2 is invalid
initialize_vector.h:9:34: error: 'int initialize_vector' redeclared as different kind of symbol
 std::vector<T> initialize_vector(T value, int s, D... dims) {
                                  ^
initialize_vector.h:5:16: note: previous declaration 'template<class T, class ... D> std::vector<_Tp> initialize_vector(T, int)'
 std::vector<T> initialize_vector(T value, int s) {
                ^~~~~~~~~~~~~~~~~
initialize_vector.h:9:34: error: 'T' was not declared in this scope
 std::vector<T> initialize_vector(T value, int s, D... dims) {
                                  ^
initialize_vector.h:9:43: error: expected primary-expression before 'int'
 std::vector<T> initialize_vector(T value, int s, D... dims) {
                                           ^~~
initialize_vector.h:9:50: error: 'D' was not declared in this scope
 std::vector<T> initialize_vector(T value, int s, D... dims) {
                                                  ^
main.cpp: In function 'int main()':
main.cpp:31:49: error: no matching function for call to 'initialize_vector<int>(int, int, int)'
         auto a = initialize_vector<int>(-1, 2, 3);
                                                 ^
In file included from main.cpp:13:0:
initialize_vector.h:5:16: note: candidate: template<class T, class ... D> std::vector<_Tp> initialize_vector(T, int)
 std::vector<T> initialize_vector(T value, int s) {
                ^~~~~~~~~~~~~~~~~
initialize_vector.h:5:16: note:   template argument deduction/substitution failed:
main.cpp:31:49: note:   candidate expects 2 arguments, 3 provided
         auto a = initialize_vector<int>(-1, 2, 3);
                                                 ^
main.cpp:37:63: error: no matching function for call to 'initialize_vector<std::__cxx11::string>(const char [4], int, int, int)'
         auto a = initialize_vector<std::string>("aba", 3, 4, 2);
                                                               ^
In file included from main.cpp:13:0:
initialize_vector.h:5:16: note: candidate: template<class T, class ... D> std::vector<_Tp> initialize_vector(T, int)
 std::vector<T> initialize_vector(T value, int s) {
                ^~~~~~~~~~~~~~~~~
initialize_vector.h:5:16: note:   template argument deduction/substitution failed:
main.cpp:37:63: note:   candidate expects 2 arguments, 4 provided
         auto a = initialize_vector<std::string>("aba", 3, 4, 2);
                                                               ^
main.cpp:52:48: error: no matching function for call to 'initialize_vector<int>(int&, int, int)'
         auto a = initialize_vector<int>(v, 2, 1);
                                                ^
In file included from main.cpp:13:0:
initialize_vector.h:5:16: note: candidate: template<class T, class ... D> std::vector<_Tp> initialize_vector(T, int)
 std::vector<T> initialize_vector(T value, int s) {
                ^~~~~~~~~~~~~~~~~
initialize_vector.h:5:16: note:   template argument deduction/substitution failed:
main.cpp:52:48: note:   candidate expects 2 arguments, 3 provided
         auto a = initialize_vector<int>(v, 2, 1);
                                                ^
In file included from main.cpp:13:0:
initialize_vector.h: In instantiation of 'std::vector<_Tp> initialize_vector(T, int) [with T = int; D = {}]':
main.cpp:25:47:   required from here
initialize_vector.h:6:30: error: 'out' was not declared in this scope
     return std::vector<T> out(s, value);
                           ~~~^~~~~~~~~~
initialize_vector.h:6:30: note: suggested alternative: 'putw'
     return std::vector<T> out(s, value);
                           ~~~^~~~~~~~~~
                           putw
initialize_vector.h: In instantiation of 'std::vector<_Tp> initialize_vector(T, int) [with T = Test; D = {}]':
main.cpp:45:47:   required from here
initialize_vector.h:6:30: error: 'out' was not declared in this scope
initialize_vector.h:6:30: note: suggested alternative: 'putw'
     return std::vector<T> out(s, value);
                           ~~~^~~~~~~~~~
                           putw
initialize_vector.h: In instantiation of 'std::vector<_Tp> initialize_vector(T, int) [with T = long int; D = {}]':
main.cpp:59:49:   required from here
initialize_vector.h:6:30: error: 'out' was not declared in this scope
initialize_vector.h:6:30: note: suggested alternative: 'putw'
     return std::vector<T> out(s, value);
                           ~~~^~~~~~~~~~
                           putw
0.117s 0.010s 9