foo.cc: In function 'int main()':
foo.cc:27:16: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
27 | int max = v1[0];
| ^
foo.cc:28:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
28 | for(int i = 1;i < v1.size(); i ++){
| ~~^~~~~~~~~~~
foo.cc:29:10: error: no match for 'operator<' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'})
29 | if(max < v1[i]) {
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_pair.h:454:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)'
454 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_pair.h:454:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator.h:331:5: note: candidate: 'template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)'
331 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:331:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator.h:369:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
369 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:369:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator.h:1160:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
1160 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:1160:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator.h:1166:5: note: candidate: 'template<class _Iterator> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)'
1166 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:1166:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:6229:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
6229 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6229:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:6242:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
6242 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6242:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:6254:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
6254 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6254:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const _CharT*' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/ios_base.h:46,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/system_error:208:3: note: candidate: 'bool std::operator<(const std::error_code&, const std::error_code&)'
208 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/9/system_error:208:31: note: no known conversion for argument 1 from 'int' to 'const std::error_code&'
208 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/9/system_error:282:3: note: candidate: 'bool std::operator<(const std::error_condition&, const std::error_condition&)'
282 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/9/system_error:282:36: note: no known conversion for argument 1 from 'int' to 'const std::error_condition&'
282 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/9/vector:67,
from foo.cc:2:
/usr/include/c++/9/bits/stl_vector.h:1905:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)'
1905 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1905:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator.h:912:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)'
912 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:912:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
29 | if(max < v1[i]) {
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator.h:919:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)'
919 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:919:5: note: template argument deduction/substitution failed:
foo.cc:29:16: note: mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
29 | if(max < v1[i]) {
| ^
foo.cc:30:14: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int' in assignment
30 | max = v1[i];
| ^
foo.cc:34:13: error: 'i' was not declared in this scope
34 | cout << v1[i] << endl << v2[num] << endl << sumsum << endl;
| ^