/in/foo.cc: In member function 'void Editor::move(int)':
/in/foo.cc:41:49: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
41 | if (prev_sum + current->data.size() >= k) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/in/foo.cc: In member function 'void Editor::delete_chars(int)':
/in/foo.cc:99:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
99 | if (pos_in_current < current->data.size()) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:100:42: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, int&)'
100 | int chars_to_delete = min(current->data.size() - pos_in_current, remaining);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/string:50,
from /usr/include/c++/12/bits/locale_classes.h:40,
from /usr/include/c++/12/bits/ios_base.h:41,
from /usr/include/c++/12/ios:42,
from /usr/include/c++/12/ostream:38,
from /usr/include/c++/12/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
230 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: template argument deduction/substitution failed:
/in/foo.cc:100:42: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
100 | int chars_to_delete = min(current->data.size() - pos_in_current, remaining);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: template argument deduction/substitution failed:
/in/foo.cc:100:42: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
100 | int chars_to_delete = min(current->data.size() - pos_in_current, remaining);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:101:60: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
101 | if (pos_in_current == 0 && chars_to_delete == current->data.size()) {
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc: In member function 'std::string Editor::get(int)':
/in/foo.cc:135:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
135 | if (pos_in_current < current->data.size()) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:136:39: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, int&)'
136 | int chars_to_get = min(current->data.size() - pos_in_current, remaining);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
230 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:230:5: note: template argument deduction/substitution failed:
/in/foo.cc:136:39: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
136 | int chars_to_get = min(current->data.size() - pos_in_current, remaining);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/12/bits/stl_algobase.h:278:5: note: template argument deduction/substitution failed:
/in/foo.cc:136:39: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
136 | int chars_to_get = min(current->data.size() - pos_in_current, remaining);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc: In member function 'void Editor::next()':
/in/foo.cc:160:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
160 | if (cursor_pos < cursor_node->data.size()) {
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:162:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
162 | if (cursor_pos == cursor_node->data.size()) {
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc: In member function 'Node* Editor::find_node_at_position(int)':
/in/foo.cc:182:51: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
182 | if (sum_so_far + current->data.size() > pos) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~