plants.cpp: In member function 'void Seg::build(int)':
plants.cpp:62:71: error: no match for 'operator+' (operand types are 'const std::pair<int, int>' and 'int')
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~
| | |
| const std::pair<int, int> int
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/bits/char_traits.h:39,
from /usr/include/c++/11/ios:40,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/stl_iterator.h:585:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_IteratorL> std::operator+(typename std::reverse_iterator<_IteratorL>::difference_type, const std::reverse_iterator<_IteratorL>&)'
585 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:585:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: mismatched types 'const std::reverse_iterator<_IteratorL>' and 'int'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/bits/char_traits.h:39,
from /usr/include/c++/11/ios:40,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/stl_iterator.h:1700:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)'
1700 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1700:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6095:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
6095 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6095:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: 'const std::pair<int, int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:56,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.tcc:1169:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
1169 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.tcc:1169:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: mismatched types 'const _CharT*' and 'std::pair<int, int>'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:56,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.tcc:1189:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
1189 | operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.tcc:1189:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
6132 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6132:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: 'const std::pair<int, int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6148:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
6148 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6148:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: 'const std::pair<int, int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6160:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
6160 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6160:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const std::pair<int, int>' have incompatible cv-qualifiers
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6166:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
6166 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6166:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: 'const std::pair<int, int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6172:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
6172 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6172:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const std::pair<int, int>' have incompatible cv-qualifiers
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6194:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
6194 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6194:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: mismatched types 'const _CharT*' and 'std::pair<int, int>'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6200:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
6200 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6200:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6206:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
6206 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6206:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const std::pair<int, int>' have incompatible cv-qualifiers
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
In file included from /usr/include/c++/11/string:55,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from plants.cpp:1:
/usr/include/c++/11/bits/basic_string.h:6212:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
6212 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6212:5: note: template argument deduction/substitution failed:
plants.cpp:62:79: note: types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const std::pair<int, int>' have incompatible cv-qualifiers
62 | tree[p].first = min(tmp1, tmp2, comparePairs) + lazy[p];
| ^
plants.cpp: In function 'bool comparePairs(const std::pair<int, int>&, const std::pair<int, int>&)':
plants.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
28 | }
| ^