Opened 3 years ago

Closed 3 years ago

#750 closed ожидаются исправления (задача НЕ сдана)

Lab 14

Reported by: antonenko.mixail Owned by: Святослав Власов
Component: WW_linq Version: 2.0
Keywords: Cc:

Description

Готов поспорить, не соберётся.

Change History (4)

comment:1 Changed 3 years ago by antonenko.mixail

Component: HW #1 (BMP)WW_linq

comment:2 Changed 3 years ago by Святослав Власов

Type: ожидается проверкаожидаются исправления

Готов поспорить, не соберётся.

Угадал!

In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:28:21: error: ‘function’ does not name a type; did you mean ‘union’?
   28 |   using Predicate = function<bool(const T&)>;
      |                     ^~~~~~~~
      |                     union
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:15: error: ‘function’ has not been declared
   45 |   auto select(function<T2(T)> f) && {
      |               ^~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:23: error: expected ‘,’ or ‘...’ before ‘<’ token
   45 |   auto select(function<T2(T)> f) && {
      |                       ^
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:14: error: ‘Predicate’ has not been declared
   49 |   auto where(Predicate predicate) && {
      |              ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In member function ‘auto linq::impl::enumerator<T>::select(int) &&’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:46:44: error: ‘f’ was not declared in this scope
   46 |     return select_enumerator<T2, T>(*this, f);
      |                                            ^
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In member function ‘virtual linq::impl::enumerator<T>& linq::impl::take_enumerator<T>::operator++()’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:109:5: error: there are no arguments to ‘assert’ that depend on a template parameter, so a declaration of ‘assert’ must be available [-fpermissive]
  109 |     assert(number_);
      |     ^~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:109:5: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: At global scope:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:146:21: error: ‘function’ does not name a type; did you mean ‘union’?
  146 |   using Predicate = function<bool(const T&)>;
      |                     ^~~~~~~~
      |                     union
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:149:3: error: ‘Predicate’ does not name a type
  149 |   Predicate predicate_;
      |   ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:156:43: error: ‘Predicate’ has not been declared
  156 |   where_enumerator(enumerator<T>& parent, Predicate predicate)
      |                                           ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In constructor ‘linq::impl::where_enumerator<T>::where_enumerator(linq::impl::enumerator<T>&, int)’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:157:26: error: class ‘linq::impl::where_enumerator<T>’ does not have any field named ‘predicate_’
  157 |       : parent_(parent), predicate_(predicate) {
      |                          ^~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: At global scope:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:173:21: error: ‘function’ does not name a type; did you mean ‘union’?
  173 |   using Predicate = function<bool(const T&)>;
      |                     ^~~~~~~~
      |                     union
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:177:3: error: ‘Predicate’ does not name a type
  177 |   Predicate predicate_;
      |   ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:185:43: error: ‘Predicate’ has not been declared
  185 |   until_enumerator(enumerator<T>& parent, Predicate predicate)
      |                                           ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In constructor ‘linq::impl::until_enumerator<T>::until_enumerator(linq::impl::enumerator<T>&, int)’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:186:26: error: class ‘linq::impl::until_enumerator<T>’ does not have any field named ‘predicate_’
  186 |       : parent_(parent), predicate_(predicate) {
      |                          ^~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In member function ‘virtual linq::impl::enumerator<T>& linq::impl::until_enumerator<T>::operator++()’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:192:5: error: there are no arguments to ‘assert’ that depend on a template parameter, so a declaration of ‘assert’ must be available [-fpermissive]
  192 |     assert(is_not_empty_);
      |     ^~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: At global scope:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:202:21: error: ‘function’ does not name a type; did you mean ‘union’?
  202 |   using Transform = function<T(T0)>;
      |                     ^~~~~~~~
      |                     union
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:203:21: error: ‘function’ does not name a type; did you mean ‘union’?
  203 |   using Predicate = function<bool(const T&)>;
      |                     ^~~~~~~~
      |                     union
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:207:3: error: ‘Transform’ does not name a type
  207 |   Transform f_;
      |   ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:215:45: error: ‘Transform’ has not been declared
  215 |   select_enumerator(enumerator<T0>& parent, Transform f)
      |                                             ^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In constructor ‘linq::impl::select_enumerator<T, T0>::select_enumerator(linq::impl::enumerator<T0>&, int)’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:216:26: error: class ‘linq::impl::select_enumerator<T, T0>’ does not have any field named ‘f_’
  216 |       : parent_(parent), f_(f) {
      |                          ^~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: At global scope:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:232:31: error: expected ‘)’ before ‘<’ token
  232 |   gen_enumerator(std::function<T()> f) : func_(std::move(f)) {
      |                 ~             ^
      |                               )
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:244:8: error: ‘function’ in namespace ‘std’ does not name a template type
  244 |   std::function<T()> func_;
      |        ^~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:4:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
    3 | #include <iostream>
  +++ |+#include <functional>
    4 | 
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In member function ‘virtual linq::impl::enumerator<T>& linq::impl::gen_enumerator<T>::operator++()’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:239:13: error: there are no arguments to ‘func_’ that depend on a template parameter, so a declaration of ‘func_’ must be available [-fpermissive]
  239 |     cache = func_();
      |             ^~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: At global scope:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:20: error: ‘function’ is not a member of ‘std’
  254 | auto generate(std::function<T()> func) {
      |                    ^~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:20: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:34: error: ‘func’ was not declared in this scope
  254 | auto generate(std::function<T()> func) {
      |                                  ^~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:39: error: expected ‘;’ before ‘{’ token
  254 | auto generate(std::function<T()> func) {
      |                                       ^~
      |                                       ;
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:26:7: error: redefinition of ‘class linq::impl::enumerator<T>’
   26 | class enumerator {
      |       ^~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:26:7: note: previous definition of ‘class linq::impl::enumerator<T>’
   26 | class enumerator {
      |       ^~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:82:7: error: redefinition of ‘class linq::impl::range_enumerator<Iter>’
   82 | class range_enumerator
      |       ^~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:82:7: note: previous definition of ‘class linq::impl::range_enumerator<Iter>’
   82 | class range_enumerator
      |       ^~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:101:7: error: redefinition of ‘class linq::impl::take_enumerator<T>’
  101 | class take_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:101:7: note: previous definition of ‘class linq::impl::take_enumerator<T>’
  101 | class take_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:123:7: error: redefinition of ‘class linq::impl::drop_enumerator<T>’
  123 | class drop_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:123:7: note: previous definition of ‘class linq::impl::drop_enumerator<T>’
  123 | class drop_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:145:7: error: redefinition of ‘class linq::impl::where_enumerator<T>’
  145 | class where_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:145:7: note: previous definition of ‘class linq::impl::where_enumerator<T>’
  145 | class where_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:171:7: error: redefinition of ‘class linq::impl::until_enumerator<T>’
  171 | class until_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:171:7: note: previous definition of ‘class linq::impl::until_enumerator<T>’
  171 | class until_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:200:7: error: redefinition of ‘class linq::impl::select_enumerator<T, T0>’
  200 | class select_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:200:7: note: previous definition of ‘class linq::impl::select_enumerator<T, T0>’
  200 | class select_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:230:7: error: redefinition of ‘class linq::impl::gen_enumerator<T>’
  230 | class gen_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:230:7: note: previous definition of ‘class linq::impl::gen_enumerator<T>’
  230 | class gen_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:249:6: error: redefinition of ‘template<class Iter> auto linq::impl::from(Iter, Iter)’
  249 | auto from(Iter beg, Iter end) {
      |      ^~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:249:6: note: ‘template<class Iter> auto linq::impl::from(Iter, Iter)’ previously declared here
  249 | auto from(Iter beg, Iter end) {
      |      ^~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:6: error: redefinition of ‘template<class T> auto linq::impl::generate’
  254 | auto generate(std::function<T()> func) {
      |      ^~~~~~~~
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:6: note: ‘template<class T> auto linq::impl::generate<T>’ previously declared here
  254 | auto generate(std::function<T()> func) {
      |      ^~~~~~~~
In file included from src/linq_tests.cpp:2:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:20: error: ‘function’ is not a member of ‘std’
  254 | auto generate(std::function<T()> func) {
      |                    ^~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:20: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:254:34: error: ‘func’ was not declared in this scope
  254 | auto generate(std::function<T()> func) {
      |                                  ^~~~
src/linq_tests.cpp: In function ‘void test_example_1()’:
src/linq_tests.cpp:89:49: error: no matching function for call to ‘linq::impl::range_enumerator<int*>::select(test_example_1()::<lambda(int)>)’
   89 |              .select([](int x) { return x * x; })
      |                                                 ^
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note: candidate: ‘template<class T2> auto linq::impl::enumerator<T>::select(int) && [with T2 = T2; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |        ^~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note:   template argument deduction/substitution failed:
src/linq_tests.cpp:89:49: note:   couldn’t deduce template parameter ‘T2’
   89 |              .select([](int x) { return x * x; })
      |                                                 ^
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In instantiation of ‘auto linq::impl::enumerator<T>::until_eq(const T&) && [with T = int]’:
src/linq_tests.cpp:101:50:   required from here
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:60:12: error: no matching function for call to ‘linq::impl::until_enumerator<int>::until_enumerator(linq::impl::enumerator<int>&, linq::impl::enumerator<T>::until_eq<int>::<lambda(const int&)>)’
   60 |     return until_enumerator<T>(*this, [&x](const T& y) { return x != y; });
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:185:3: note: candidate: ‘linq::impl::until_enumerator<T>::until_enumerator(linq::impl::enumerator<T>&, int) [with T = int]’
  185 |   until_enumerator(enumerator<T>& parent, Predicate predicate)
      |   ^~~~~~~~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:185:53: note:   no known conversion for argument 2 from ‘linq::impl::enumerator<T>::until_eq<int>::<lambda(const int&)>’ to ‘int’
  185 |   until_enumerator(enumerator<T>& parent, Predicate predicate)
      |                                           ~~~~~~~~~~^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:171:7: note: candidate: ‘constexpr linq::impl::until_enumerator<int>::until_enumerator(linq::impl::until_enumerator<int>&&)’
  171 | class until_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:171:7: note:   candidate expects 1 argument, 2 provided
src/linq_tests.cpp: In function ‘void test_example_3()’:
src/linq_tests.cpp:113:77: error: invalid user-defined conversion from ‘test_example_3()::<lambda(int)>’ to ‘int’ [-fpermissive]
  113 |   auto res = to_stream(xs).select<double>([](int x) { return std::sqrt(x); })
      |                                                                             ^
src/linq_tests.cpp:113:43: note: candidate is: ‘constexpr test_example_3()::<lambda(int)>::operator double (*)(int)() const’ (near match)
  113 |   auto res = to_stream(xs).select<double>([](int x) { return std::sqrt(x); })
      |                                           ^
src/linq_tests.cpp:113:43: note:   no known conversion from ‘double (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:15: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::select(int) && [with T2 = double; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |               ^~~~~~~~
src/linq_tests.cpp: In function ‘void test_copy_to()’:
src/linq_tests.cpp:146:45: error: cannot convert ‘std::back_insert_iterator<std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > > >’ to ‘std::ostream_iterator<std::__cxx11::basic_string<char>, char, std::char_traits<char> >’
  146 |     to_stream(xs).copy_to(std::back_inserter(xs_copy));
      |                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~
      |                                             |
      |                                             std::back_insert_iterator<std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > > >
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:63:36: note:   initializing argument 1 of ‘void linq::impl::enumerator<T>::copy_to(std::ostream_iterator<T>) && [with T = std::__cxx11::basic_string<char>]’
   63 |   void copy_to(ostream_iterator<T> out) && {
      |                ~~~~~~~~~~~~~~~~~~~~^~~
src/linq_tests.cpp:163:45: error: cannot convert ‘std::back_insert_iterator<std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > > >’ to ‘std::ostream_iterator<std::__cxx11::basic_string<char>, char, std::char_traits<char> >’
  163 |     to_stream(xs).copy_to(std::back_inserter(xs_copy));
      |                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~
      |                                             |
      |                                             std::back_insert_iterator<std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > > >
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:63:36: note:   initializing argument 1 of ‘void linq::impl::enumerator<T>::copy_to(std::ostream_iterator<T>) && [with T = std::__cxx11::basic_string<char>]’
   63 |   void copy_to(ostream_iterator<T> out) && {
      |                ~~~~~~~~~~~~~~~~~~~~^~~
src/linq_tests.cpp: In function ‘void test_until()’:
src/linq_tests.cpp:263:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  263 |     auto res = to_stream(xs).until([](int x) { return x < 0; }).to_vector();
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp:270:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  270 |     auto res = to_stream(xs).until([](int x) { return 1234 < x; }).to_vector();
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp:305:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  305 |     auto res = to_stream(xs).until(force_move([](int x) { return x < 0; })).to_vector();
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp:312:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  312 |     auto res = to_stream(xs).until([](int x) { return x < 0; }).to_vector();
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp:319:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  319 |     auto res = to_stream(xs).until([](int x) { return x < 0; }).to_vector();
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp:333:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  333 |     auto res = to_stream(xs).until([](int x) {
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp:343:30: error: ‘class linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >’ has no member named ‘until’; did you mean ‘until_eq’?
  343 |     auto res = to_stream(xs).until([](int x) {
      |                              ^~~~~
      |                              until_eq
src/linq_tests.cpp: In function ‘void test_where()’:
src/linq_tests.cpp:358:68: error: invalid user-defined conversion from ‘test_where()::<lambda(int)>’ to ‘int’ [-fpermissive]
  358 |     auto res = to_stream(xs).where([](int x) { return x % 3 == 0; })
      |                                                                    ^
src/linq_tests.cpp:358:36: note: candidate is: ‘constexpr test_where()::<lambda(int)>::operator bool (*)(int)() const’ (near match)
  358 |     auto res = to_stream(xs).where([](int x) { return x % 3 == 0; })
      |                                    ^
src/linq_tests.cpp:358:36: note:   no known conversion from ‘bool (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
src/linq_tests.cpp:366:64: error: invalid user-defined conversion from ‘test_where()::<lambda(int)>’ to ‘int’ [-fpermissive]
  366 |     auto res = to_stream(xs).where([](int x) { return 12 < x; }).to_vector();
      |                                                                ^
src/linq_tests.cpp:366:36: note: candidate is: ‘constexpr test_where()::<lambda(int)>::operator bool (*)(int)() const’ (near match)
  366 |     auto res = to_stream(xs).where([](int x) { return 12 < x; }).to_vector();
      |                                    ^
src/linq_tests.cpp:366:36: note:   no known conversion from ‘bool (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
src/linq_tests.cpp:373:59: error: invalid user-defined conversion from ‘test_where()::<lambda(int)>’ to ‘int’ [-fpermissive]
  373 |     auto res = to_stream(xs).where([](int){ return true; }).to_vector();
      |                                                           ^
src/linq_tests.cpp:373:36: note: candidate is: ‘constexpr test_where()::<lambda(int)>::operator bool (*)(int)() const’ (near match)
  373 |     auto res = to_stream(xs).where([](int){ return true; }).to_vector();
      |                                    ^
src/linq_tests.cpp:373:36: note:   no known conversion from ‘bool (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In instantiation of ‘auto linq::impl::enumerator<T>::where_neq(const T&) && [with T = int]’:
src/linq_tests.cpp:380:41:   required from here
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:54:12: error: no matching function for call to ‘linq::impl::where_enumerator<int>::where_enumerator(linq::impl::enumerator<int>&, linq::impl::enumerator<T>::where_neq<int>::<lambda(const int&)>)’
   54 |     return where_enumerator<T>(*this, [&x](const T& y) { return y != x; });
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:156:3: note: candidate: ‘linq::impl::where_enumerator<T>::where_enumerator(linq::impl::enumerator<T>&, int) [with T = int]’
  156 |   where_enumerator(enumerator<T>& parent, Predicate predicate)
      |   ^~~~~~~~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:156:53: note:   no known conversion for argument 2 from ‘linq::impl::enumerator<T>::where_neq<int>::<lambda(const int&)>’ to ‘int’
  156 |   where_enumerator(enumerator<T>& parent, Predicate predicate)
      |                                           ~~~~~~~~~~^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:145:7: note: candidate: ‘constexpr linq::impl::where_enumerator<int>::where_enumerator(linq::impl::where_enumerator<int>&&)’
  145 | class where_enumerator : public enumerator<T> {
      |       ^~~~~~~~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:145:7: note:   candidate expects 1 argument, 2 provided
src/linq_tests.cpp:394:46: error: cannot convert ‘NonCopyableFunctorWrapper<test_where()::<lambda(int)> >’ to ‘int’
  394 |     auto res = to_stream(xs).where(force_move([](int x) { return x % 3 == 0; }))
      |                                    ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                              |
      |                                              NonCopyableFunctorWrapper<test_where()::<lambda(int)> >
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
src/linq_tests.cpp:402:68: error: invalid user-defined conversion from ‘test_where()::<lambda(int)>’ to ‘int’ [-fpermissive]
  402 |     auto res = to_stream(xs).where([](int x) { return x % 3 == 0; })
      |                                                                    ^
src/linq_tests.cpp:402:36: note: candidate is: ‘constexpr test_where()::<lambda(int)>::operator bool (*)(int)() const’ (near match)
  402 |     auto res = to_stream(xs).where([](int x) { return x % 3 == 0; })
      |                                    ^
src/linq_tests.cpp:402:36: note:   no known conversion from ‘bool (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
src/linq_tests.cpp:410:68: error: invalid user-defined conversion from ‘test_where()::<lambda(int)>’ to ‘int’ [-fpermissive]
  410 |     auto res = to_stream(xs).where([](int x) { return x % 3 == 0; })
      |                                                                    ^
src/linq_tests.cpp:410:36: note: candidate is: ‘constexpr test_where()::<lambda(int)>::operator bool (*)(int)() const’ (near match)
  410 |     auto res = to_stream(xs).where([](int x) { return x % 3 == 0; })
      |                                    ^
src/linq_tests.cpp:410:36: note:   no known conversion from ‘bool (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
src/linq_tests.cpp:421:6: error: invalid user-defined conversion from ‘test_where()::<lambda(int)>’ to ‘int’ [-fpermissive]
  421 |     }).to_vector();
      |      ^
src/linq_tests.cpp:418:36: note: candidate is: ‘constexpr test_where()::<lambda(int)>::operator bool (*)(int)() const’ (near match)
  418 |     auto res = to_stream(xs).where([](int x) {
      |                                    ^
src/linq_tests.cpp:418:36: note:   no known conversion from ‘bool (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:49:24: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
   49 |   auto where(Predicate predicate) && {
      |              ~~~~~~~~~~^~~~~~~~~
src/linq_tests.cpp: In function ‘void test_select()’:
src/linq_tests.cpp:430:64: error: no matching function for call to ‘linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::select(test_select()::<lambda(int)>)’
  430 |     auto res = to_stream(xs).select([](int x) { return x + 2; })
      |                                                                ^
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note: candidate: ‘template<class T2> auto linq::impl::enumerator<T>::select(int) && [with T2 = T2; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |        ^~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note:   template argument deduction/substitution failed:
src/linq_tests.cpp:430:64: note:   couldn’t deduce template parameter ‘T2’
  430 |     auto res = to_stream(xs).select([](int x) { return x + 2; })
      |                                                                ^
src/linq_tests.cpp:439:76: error: invalid user-defined conversion from ‘test_select()::<lambda(int)>’ to ‘int’ [-fpermissive]
  439 |                .select<std::string>([](int x) { return std::to_string(x); })
      |                                                                            ^
src/linq_tests.cpp:439:37: note: candidate is: ‘constexpr test_select()::<lambda(int)>::operator std::__cxx11::basic_string<char> (*)(int)() const’ (near match)
  439 |                .select<std::string>([](int x) { return std::to_string(x); })
      |                                     ^
src/linq_tests.cpp:439:37: note:   no known conversion from ‘std::__cxx11::basic_string<char> (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:15: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::select(int) && [with T2 = std::__cxx11::basic_string<char>; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |               ^~~~~~~~
src/linq_tests.cpp:447:76: error: no matching function for call to ‘linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::select(NonCopyableFunctorWrapper<test_select()::<lambda(int)> >)’
  447 |     auto res = to_stream(xs).select(force_move([](int x) { return x + 2; }))
      |                                                                            ^
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note: candidate: ‘template<class T2> auto linq::impl::enumerator<T>::select(int) && [with T2 = T2; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |        ^~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note:   template argument deduction/substitution failed:
src/linq_tests.cpp:447:76: note:   couldn’t deduce template parameter ‘T2’
  447 |     auto res = to_stream(xs).select(force_move([](int x) { return x + 2; }))
      |                                                                            ^
src/linq_tests.cpp:455:64: error: no matching function for call to ‘linq::impl::range_enumerator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >::select(test_select()::<lambda(int)>)’
  455 |     auto res = to_stream(xs).select([](int x) { return x + 2; })
      |                                                                ^
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note: candidate: ‘template<class T2> auto linq::impl::enumerator<T>::select(int) && [with T2 = T2; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |        ^~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:8: note:   template argument deduction/substitution failed:
src/linq_tests.cpp:455:64: note:   couldn’t deduce template parameter ‘T2’
  455 |     auto res = to_stream(xs).select([](int x) { return x + 2; })
      |                                                                ^
src/linq_tests.cpp:468:6: error: invalid user-defined conversion from ‘test_select()::<lambda(int)>’ to ‘int’ [-fpermissive]
  468 |     }).to_vector();
      |      ^
src/linq_tests.cpp:463:43: note: candidate is: ‘constexpr test_select()::<lambda(int)>::operator char (*)(int)() const’ (near match)
  463 |     auto res = to_stream(xs).select<char>([](int x) {
      |                                           ^
src/linq_tests.cpp:463:43: note:   no known conversion from ‘char (*)(int)’ to ‘int’
In file included from src/linq_tests.cpp:1:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:45:15: note:   initializing argument 1 of ‘auto linq::impl::enumerator<T>::select(int) && [with T2 = char; T = int]’
   45 |   auto select(function<T2(T)> f) && {
      |               ^~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In instantiation of ‘void linq::impl::where_enumerator<T>::skip_() [with T = int]’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:158:5:   required from ‘linq::impl::where_enumerator<T>::where_enumerator(linq::impl::enumerator<T>&, int) [with T = int]’
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:50:12:   required from ‘auto linq::impl::enumerator<T>::where(int) && [with T = int]’
src/linq_tests.cpp:358:68:   required from here
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:152:38: error: ‘predicate_’ was not declared in this scope
  152 |     while (parent_ and not predicate_(*parent_)) ++parent_;
      |                            ~~~~~~~~~~^~~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In instantiation of ‘linq::impl::enumerator<T>& linq::impl::where_enumerator<T>::operator++() [with T = int]’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:162:26:   required from here
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:163:11: error: ‘assert’ was not declared in this scope
  163 |     assert(parent_);
      |     ~~~~~~^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:4:1: note: ‘assert’ is defined in header ‘<cassert>’; did you forget to ‘#include <cassert>’?
    3 | #include <iostream>
  +++ |+#include <cassert>
    4 | 
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp: In instantiation of ‘linq::impl::enumerator<T>& linq::impl::take_enumerator<T>::operator++() [with T = int]’:
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:108:26:   required from here
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:109:11: error: ‘assert’ was not declared in this scope
  109 |     assert(number_);
      |     ~~~~~~^~~~~~~~~
../../../homeworks/antonenko.mixail/lab_14/include/linq.hpp:109:11: note: ‘assert’ is defined in header ‘<cassert>’; did you forget to ‘#include <cassert>’?

comment:3 Changed 3 years ago by antonenko.mixail

Type: ожидаются исправленияожидается проверка
Version: 1.02.0

comment:4 Changed 3 years ago by Святослав Власов

Resolution: задача НЕ сдана
Status: assignedclosed
Type: ожидается проверкаожидаются исправления

Не собралось опять

  1. Нет инклюд-гардов
  2. select и прочие методы не должен требовать указания шаблонного параметра
  3. copy_to должен уметь работать с любым выходным итератором, а не только с ostream_iterator
  4. Нет метода until
Note: See TracTickets for help on using tickets.