теперь выдает такие ошибки main.cpp: In function 'void TestProperties()':…
- User
теперь выдает такие ошибки main.cpp: In function 'void TestProperties()': main.cpp:105:39: error: no match for 'operator+' (operand types are 'const long int' and 'const FlattenedVector::Iterator') 105 | assert((it_a + diff) == (diff + it_a)); | ~~~~ ^ ~~~~ | | | | | const FlattenedVector::Iterator | const long int In file included from main.cpp:1: flatten.h:180:39: note: candidate: 'template typename FlattenedVector::Iterator operator+(typename FlattenedVector::std::ptrdiff_t, const typename FlattenedVector::Iterator&)' 180 | typename FlattenedVector::Iterator operator+( | ^~~~~~~~ flatten.h:180:39: note: template argument deduction/substitution failed: main.cpp:105:41: note: couldn't deduce template parameter 'T' 105 | assert((it_a + diff) == (diff + it_a)); | ^~~~ main.cpp: In function 'void TestModify()': main.cpp:203:13: error: assignment of read-only location 'it.FlattenedVector::Iterator::operator*()' 203 | it = new_value; | ~~~~^~~~~~~~~~~ main.cpp:207:15: error: assignment of read-only location 'it.FlattenedVector::Iterator::operator' 207 | it[1] = value; flatten.h: In instantiation of 'T& FlattenedVector::Iterator::operator() [with T = long int]': main.cpp:79:54: required from here flatten.h:43:46: error: binding reference of type 'long int&' to 'const long int' discards qualifiers 43 | return parent_ -> at(ind_); | ^ flatten.h: In instantiation of 'T& FlattenedVector::Iterator::operator*() [with T = int]': main.cpp:93:9: required from here flatten.h:43:46: error: binding reference of type 'int&' to 'const int' discards qualifiers flatten.h: In instantiation of 'T& FlattenedVector::Iterator::operator [with T = int; std::ptrdiff_t = long int]': main.cpp:157:5: required from here flatten.h:99:50: error: binding reference of type 'int&' to 'const int' discards qualifiers 99 | return parent_ -> at(ind_ + n); | ^ flatten.h: In instantiation of 'T& FlattenedVector::Iterator::operator*() [with T = {anonymous}::TestData]': main.cpp:189:23: required from here flatten.h:43:46: error: binding reference of type '{anonymous}::TestData&' to 'const {anonymous}::TestData' discards qualifiers 43 | return parent_ -> at(ind_); | ^ flatten.h: In instantiation of 'T& FlattenedVector::Iterator::operator*() [with T = char]': main.cpp:208:9: required from here flatten.h:43:46: error: binding reference of type 'char&' to 'const char' discards qualifiers flatten.h: In instantiation of 'T& FlattenedVector::Iterator::operator*() [with T = long unsigned int]': main.cpp:244:13: required from here flatten.h:43:46: error: binding reference of type 'long unsigned int&' to 'const long unsigned int' discards qualifiers
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.