Advertisement
Dzham

Untitled

Feb 20th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.50 KB | None | 0 0
  1. stdout:
  2. sh ./doit.sh
  3. Makefile:4: recipe for target 'build' failed
  4.  
  5.  
  6. stderr:
  7. test_31415926.cpp: In function ‘void testConstantOperations()’:
  8. test_31415926.cpp:280:20: error: passing ‘const Polynomial<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  9. unused(a.begin());
  10. ^
  11. In file included from test_31415926.cpp:2:
  12. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = int]’
  13. auto begin() {
  14. ^~~~~
  15. test_31415926.cpp:281:18: error: passing ‘const Polynomial<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  16. unused(a.end());
  17. ^
  18. In file included from test_31415926.cpp:2:
  19. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = int]’
  20. auto end() {
  21. ^~~
  22. poly.h: In instantiation of ‘const T& Polynomial<T>::operator[](int) const [with T = int]’:
  23. test_31415926.cpp:282:15: required from here
  24. poly.h:58:20: error: returning reference to temporary [-Werror=return-local-addr]
  25. return 0;
  26. ^
  27. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator+=(const Polynomial<T>&) [with T = int]’:
  28. poly.h:103:19: required from ‘Polynomial<T> operator+(const Polynomial<T>&, const Polynomial<T>&) [with T = int]’
  29. test_31415926.cpp:275:16: required from here
  30. poly.h:75:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int, std::allocator<int> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  31. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  32. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator-=(const Polynomial<T>&) [with T = int]’:
  33. poly.h:109:19: required from ‘Polynomial<T> operator-(const Polynomial<T>&, const Polynomial<T>&) [with T = int]’
  34. test_31415926.cpp:276:16: required from here
  35. poly.h:85:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int, std::allocator<int> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  36. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  37. test_31415926.cpp: In instantiation of ‘void iterator_out(const Polynomial<T>&) [with T = int]’:
  38. test_31415926.cpp:130:17: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = int]’
  39. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  40. test_31415926.cpp:292:24: required from here
  41. test_31415926.cpp:116:81: error: passing ‘const Polynomial<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  42. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  43. In file included from test_31415926.cpp:2:
  44. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = int]’
  45. auto begin() {
  46. ^~~~~
  47. test_31415926.cpp:116:19: error: static assertion failed: Your iterators are not const
  48. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  49. ^~~
  50. test_31415926.cpp:118:15: error: passing ‘const Polynomial<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  51. for (auto it = p.begin(); it != p.end(); ++it)
  52. ^~
  53. In file included from test_31415926.cpp:2:
  54. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = int]’
  55. auto begin() {
  56. ^~~~~
  57. test_31415926.cpp:118:34: error: passing ‘const Polynomial<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  58. for (auto it = p.begin(); it != p.end(); ++it)
  59. In file included from test_31415926.cpp:2:
  60. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = int]’
  61. auto end() {
  62. ^~~
  63. test_31415926.cpp: In instantiation of ‘void iterator_out(const Polynomial<T>&) [with T = long long int]’:
  64. test_31415926.cpp:130:17: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = long long int]’
  65. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = long long int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  66. test_31415926.cpp:293:30: required from here
  67. test_31415926.cpp:116:81: error: passing ‘const Polynomial<long long int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  68. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  69. In file included from test_31415926.cpp:2:
  70. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = long long int]’
  71. auto begin() {
  72. ^~~~~
  73. test_31415926.cpp:116:19: error: static assertion failed: Your iterators are not const
  74. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  75. ^~~
  76. test_31415926.cpp:118:15: error: passing ‘const Polynomial<long long int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  77. for (auto it = p.begin(); it != p.end(); ++it)
  78. ^~
  79. In file included from test_31415926.cpp:2:
  80. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = long long int]’
  81. auto begin() {
  82. ^~~~~
  83. test_31415926.cpp:118:34: error: passing ‘const Polynomial<long long int>’ as ‘this’ argument discards qualifiers [-fpermissive]
  84. for (auto it = p.begin(); it != p.end(); ++it)
  85. In file included from test_31415926.cpp:2:
  86. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = long long int]’
  87. auto end() {
  88. ^~~
  89. poly.h: In instantiation of ‘const T& Polynomial<T>::operator[](int) const [with T = long long int]’:
  90. test_31415926.cpp:131:33: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = long long int]’
  91. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = long long int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  92. test_31415926.cpp:293:30: required from here
  93. poly.h:58:20: error: returning reference to temporary [-Werror=return-local-addr]
  94. return 0;
  95. ^
  96. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator+=(const Polynomial<T>&) [with T = long long int]’:
  97. test_31415926.cpp:138:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = long long int]’
  98. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = long long int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  99. test_31415926.cpp:293:30: required from here
  100. poly.h:75:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<long long int, std::allocator<long long int> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  101. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  102. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator-=(const Polynomial<T>&) [with T = long long int]’:
  103. test_31415926.cpp:140:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = long long int]’
  104. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = long long int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  105. test_31415926.cpp:293:30: required from here
  106. poly.h:85:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<long long int, std::allocator<long long int> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  107. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  108. test_31415926.cpp: In instantiation of ‘void iterator_out(const Polynomial<T>&) [with T = double]’:
  109. test_31415926.cpp:130:17: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = double]’
  110. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = double; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  111. test_31415926.cpp:294:27: required from here
  112. test_31415926.cpp:116:81: error: passing ‘const Polynomial<double>’ as ‘this’ argument discards qualifiers [-fpermissive]
  113. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  114. In file included from test_31415926.cpp:2:
  115. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = double]’
  116. auto begin() {
  117. ^~~~~
  118. test_31415926.cpp:116:19: error: static assertion failed: Your iterators are not const
  119. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  120. ^~~
  121. test_31415926.cpp:118:15: error: passing ‘const Polynomial<double>’ as ‘this’ argument discards qualifiers [-fpermissive]
  122. for (auto it = p.begin(); it != p.end(); ++it)
  123. ^~
  124. In file included from test_31415926.cpp:2:
  125. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = double]’
  126. auto begin() {
  127. ^~~~~
  128. test_31415926.cpp:118:34: error: passing ‘const Polynomial<double>’ as ‘this’ argument discards qualifiers [-fpermissive]
  129. for (auto it = p.begin(); it != p.end(); ++it)
  130. In file included from test_31415926.cpp:2:
  131. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = double]’
  132. auto end() {
  133. ^~~
  134. poly.h: In instantiation of ‘const T& Polynomial<T>::operator[](int) const [with T = double]’:
  135. test_31415926.cpp:131:33: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = double]’
  136. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = double; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  137. test_31415926.cpp:294:27: required from here
  138. poly.h:58:20: error: returning reference to temporary [-Werror=return-local-addr]
  139. return 0;
  140. ^
  141. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator+=(const Polynomial<T>&) [with T = double]’:
  142. test_31415926.cpp:138:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = double]’
  143. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = double; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  144. test_31415926.cpp:294:27: required from here
  145. poly.h:75:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<double, std::allocator<double> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  146. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  147. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator-=(const Polynomial<T>&) [with T = double]’:
  148. test_31415926.cpp:140:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = double]’
  149. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = double; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  150. test_31415926.cpp:294:27: required from here
  151. poly.h:85:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<double, std::allocator<double> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  152. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  153. poly.h: In instantiation of ‘void Polynomial<T>::clear_zeroes() [with T = NumberWrapper<int>]’:
  154. poly.h:29:15: required from ‘Polynomial<T>::Polynomial(const std::vector<T>&) [with T = NumberWrapper<int>]’
  155. test_31415926.cpp:250:23: required from ‘void runTests(const string&) [with T = NumberWrapper<int>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  156. test_31415926.cpp:295:39: required from here
  157. poly.h:11:33: error: no match for ‘operator==’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<NumberWrapper<int> >, NumberWrapper<int> >::value_type’ {aka ‘NumberWrapper<int>’} and ‘int’)
  158. if (coefficients[i] == 0) {
  159. ~~~~~~~~~~~~~~~~^~~~
  160. poly.h:11:33: note: candidate: ‘operator==(int, int)’ <built-in>
  161. poly.h:11:33: note: no known conversion for argument 1 from ‘__gnu_cxx::__alloc_traits<std::allocator<NumberWrapper<int> >, NumberWrapper<int> >::value_type’ {aka ‘NumberWrapper<int>’} to ‘int’
  162. In file included from test_31415926.cpp:3:
  163. number_wrapper.h:88:10: note: candidate: ‘bool NumberWrapper<T>::operator==(const NumberWrapper<T>&) const [with T = int]’
  164. bool operator==(const NumberWrapper& other) const {
  165. ^~~~~~~~
  166. number_wrapper.h:88:10: note: no known conversion for argument 1 from ‘int’ to ‘const NumberWrapper<int>&’
  167. In file included from test_31415926.cpp:4:
  168. rational.h:114:6: note: candidate: ‘bool operator==(const Rational&, const Rational&)’
  169. bool operator == (const Rational& p, const Rational& q) {
  170. ^~~~~~~~
  171. rational.h:114:6: note: no known conversion for argument 1 from ‘__gnu_cxx::__alloc_traits<std::allocator<NumberWrapper<int> >, NumberWrapper<int> >::value_type’ {aka ‘NumberWrapper<int>’} to ‘const Rational&’
  172. test_31415926.cpp: In instantiation of ‘void iterator_out(const Polynomial<T>&) [with T = NumberWrapper<int>]’:
  173. test_31415926.cpp:130:17: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<int>]’
  174. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<int>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  175. test_31415926.cpp:295:39: required from here
  176. test_31415926.cpp:116:81: error: passing ‘const Polynomial<NumberWrapper<int> >’ as ‘this’ argument discards qualifiers [-fpermissive]
  177. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  178. In file included from test_31415926.cpp:2:
  179. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = NumberWrapper<int>]’
  180. auto begin() {
  181. ^~~~~
  182. test_31415926.cpp:116:19: error: static assertion failed: Your iterators are not const
  183. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  184. ^~~
  185. test_31415926.cpp:118:15: error: passing ‘const Polynomial<NumberWrapper<int> >’ as ‘this’ argument discards qualifiers [-fpermissive]
  186. for (auto it = p.begin(); it != p.end(); ++it)
  187. ^~
  188. In file included from test_31415926.cpp:2:
  189. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = NumberWrapper<int>]’
  190. auto begin() {
  191. ^~~~~
  192. test_31415926.cpp:118:34: error: passing ‘const Polynomial<NumberWrapper<int> >’ as ‘this’ argument discards qualifiers [-fpermissive]
  193. for (auto it = p.begin(); it != p.end(); ++it)
  194. In file included from test_31415926.cpp:2:
  195. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = NumberWrapper<int>]’
  196. auto end() {
  197. ^~~
  198. poly.h: In instantiation of ‘const T& Polynomial<T>::operator[](int) const [with T = NumberWrapper<int>]’:
  199. test_31415926.cpp:131:33: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<int>]’
  200. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<int>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  201. test_31415926.cpp:295:39: required from here
  202. poly.h:58:20: error: invalid initialization of reference of type ‘const NumberWrapper<int>&’ from expression of type ‘int’
  203. return 0;
  204. ^
  205. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator+=(const Polynomial<T>&) [with T = NumberWrapper<int>]’:
  206. test_31415926.cpp:138:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<int>]’
  207. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<int>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  208. test_31415926.cpp:295:39: required from here
  209. poly.h:75:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<NumberWrapper<int>, std::allocator<NumberWrapper<int> > >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  210. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  211. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator-=(const Polynomial<T>&) [with T = NumberWrapper<int>]’:
  212. test_31415926.cpp:140:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<int>]’
  213. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<int>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  214. test_31415926.cpp:295:39: required from here
  215. poly.h:85:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<NumberWrapper<int>, std::allocator<NumberWrapper<int> > >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  216. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  217. poly.h: In instantiation of ‘void Polynomial<T>::clear_zeroes() [with T = NumberWrapper<double>]’:
  218. poly.h:29:15: required from ‘Polynomial<T>::Polynomial(const std::vector<T>&) [with T = NumberWrapper<double>]’
  219. test_31415926.cpp:250:23: required from ‘void runTests(const string&) [with T = NumberWrapper<double>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  220. test_31415926.cpp:296:42: required from here
  221. poly.h:11:33: error: no match for ‘operator==’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<NumberWrapper<double> >, NumberWrapper<double> >::value_type’ {aka ‘NumberWrapper<double>’} and ‘int’)
  222. if (coefficients[i] == 0) {
  223. ~~~~~~~~~~~~~~~~^~~~
  224. poly.h:11:33: note: candidate: ‘operator==(double, int)’ <built-in>
  225. poly.h:11:33: note: no known conversion for argument 1 from ‘__gnu_cxx::__alloc_traits<std::allocator<NumberWrapper<double> >, NumberWrapper<double> >::value_type’ {aka ‘NumberWrapper<double>’} to ‘double’
  226. In file included from test_31415926.cpp:3:
  227. number_wrapper.h:88:10: note: candidate: ‘bool NumberWrapper<T>::operator==(const NumberWrapper<T>&) const [with T = double]’
  228. bool operator==(const NumberWrapper& other) const {
  229. ^~~~~~~~
  230. number_wrapper.h:88:10: note: no known conversion for argument 1 from ‘int’ to ‘const NumberWrapper<double>&’
  231. In file included from test_31415926.cpp:4:
  232. rational.h:114:6: note: candidate: ‘bool operator==(const Rational&, const Rational&)’
  233. bool operator == (const Rational& p, const Rational& q) {
  234. ^~~~~~~~
  235. rational.h:114:6: note: no known conversion for argument 1 from ‘__gnu_cxx::__alloc_traits<std::allocator<NumberWrapper<double> >, NumberWrapper<double> >::value_type’ {aka ‘NumberWrapper<double>’} to ‘const Rational&’
  236. test_31415926.cpp: In instantiation of ‘void iterator_out(const Polynomial<T>&) [with T = NumberWrapper<double>]’:
  237. test_31415926.cpp:130:17: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<double>]’
  238. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<double>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  239. test_31415926.cpp:296:42: required from here
  240. test_31415926.cpp:116:81: error: passing ‘const Polynomial<NumberWrapper<double> >’ as ‘this’ argument discards qualifiers [-fpermissive]
  241. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  242. In file included from test_31415926.cpp:2:
  243. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = NumberWrapper<double>]’
  244. auto begin() {
  245. ^~~~~
  246. test_31415926.cpp:116:19: error: static assertion failed: Your iterators are not const
  247. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  248. ^~~
  249. test_31415926.cpp:118:15: error: passing ‘const Polynomial<NumberWrapper<double> >’ as ‘this’ argument discards qualifiers [-fpermissive]
  250. for (auto it = p.begin(); it != p.end(); ++it)
  251. ^~
  252. In file included from test_31415926.cpp:2:
  253. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = NumberWrapper<double>]’
  254. auto begin() {
  255. ^~~~~
  256. test_31415926.cpp:118:34: error: passing ‘const Polynomial<NumberWrapper<double> >’ as ‘this’ argument discards qualifiers [-fpermissive]
  257. for (auto it = p.begin(); it != p.end(); ++it)
  258. In file included from test_31415926.cpp:2:
  259. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = NumberWrapper<double>]’
  260. auto end() {
  261. ^~~
  262. poly.h: In instantiation of ‘const T& Polynomial<T>::operator[](int) const [with T = NumberWrapper<double>]’:
  263. test_31415926.cpp:131:33: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<double>]’
  264. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<double>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  265. test_31415926.cpp:296:42: required from here
  266. poly.h:58:20: error: invalid initialization of reference of type ‘const NumberWrapper<double>&’ from expression of type ‘int’
  267. return 0;
  268. ^
  269. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator+=(const Polynomial<T>&) [with T = NumberWrapper<double>]’:
  270. test_31415926.cpp:138:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<double>]’
  271. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<double>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  272. test_31415926.cpp:296:42: required from here
  273. poly.h:75:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<NumberWrapper<double>, std::allocator<NumberWrapper<double> > >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  274. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  275. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator-=(const Polynomial<T>&) [with T = NumberWrapper<double>]’:
  276. test_31415926.cpp:140:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = NumberWrapper<double>]’
  277. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = NumberWrapper<double>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  278. test_31415926.cpp:296:42: required from here
  279. poly.h:85:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<NumberWrapper<double>, std::allocator<NumberWrapper<double> > >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  280. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  281. test_31415926.cpp: In instantiation of ‘void iterator_out(const Polynomial<T>&) [with T = Rational]’:
  282. test_31415926.cpp:130:17: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = Rational]’
  283. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = Rational; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  284. test_31415926.cpp:297:29: required from here
  285. test_31415926.cpp:116:81: error: passing ‘const Polynomial<Rational>’ as ‘this’ argument discards qualifiers [-fpermissive]
  286. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  287. In file included from test_31415926.cpp:2:
  288. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = Rational]’
  289. auto begin() {
  290. ^~~~~
  291. test_31415926.cpp:116:19: error: static assertion failed: Your iterators are not const
  292. static_assert(std::is_same<const T, typename std::remove_reference<decltype(*p.begin())>::type>::value,
  293. ^~~
  294. test_31415926.cpp:118:15: error: passing ‘const Polynomial<Rational>’ as ‘this’ argument discards qualifiers [-fpermissive]
  295. for (auto it = p.begin(); it != p.end(); ++it)
  296. ^~
  297. In file included from test_31415926.cpp:2:
  298. poly.h:91:10: note: in call to ‘auto Polynomial<T>::begin() [with T = Rational]’
  299. auto begin() {
  300. ^~~~~
  301. test_31415926.cpp:118:34: error: passing ‘const Polynomial<Rational>’ as ‘this’ argument discards qualifiers [-fpermissive]
  302. for (auto it = p.begin(); it != p.end(); ++it)
  303. In file included from test_31415926.cpp:2:
  304. poly.h:95:10: note: in call to ‘auto Polynomial<T>::end() [with T = Rational]’
  305. auto end() {
  306. ^~~
  307. poly.h: In instantiation of ‘const T& Polynomial<T>::operator[](int) const [with T = Rational]’:
  308. test_31415926.cpp:131:33: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = Rational]’
  309. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = Rational; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  310. test_31415926.cpp:297:29: required from here
  311. poly.h:58:20: error: returning reference to temporary [-Werror=return-local-addr]
  312. return 0;
  313. ^
  314. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator+=(const Polynomial<T>&) [with T = Rational]’:
  315. test_31415926.cpp:138:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = Rational]’
  316. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = Rational; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  317. test_31415926.cpp:297:29: required from here
  318. poly.h:75:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<Rational, std::allocator<Rational> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  319. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  320. poly.h: In instantiation of ‘Polynomial<T>& Polynomial<T>::operator-=(const Polynomial<T>&) [with T = Rational]’:
  321. test_31415926.cpp:140:7: required from ‘void first_group(Polynomial<T>, Polynomial<T>) [with T = Rational]’
  322. test_31415926.cpp:253:24: required from ‘void runTests(const string&) [with T = Rational; std::__cxx11::string = std::__cxx11::basic_string<char>]’
  323. test_31415926.cpp:297:29: required from here
  324. poly.h:85:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<Rational, std::allocator<Rational> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  325. for (int i = 0; i < p.GetCoeff().size(); ++i) {
  326. cc1plus: all warnings being treated as errors
  327. make: *** [build] Error 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement