/in/foo.cc: In function 'bool compareDates(const string&, const string&)':
/in/foo.cc:10:17: error: passing 'const string' {aka 'const std::__cxx11::basic_string<char>'} as 'this' argument discards qualifiers [-fpermissive]
10 | a.erase(0, 5);
| ^
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 /in/foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:1811:7: note: in call to 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]'
1811 | erase(size_type __pos = 0, size_type __n = npos)
| ^~~~~
/in/foo.cc:12:17: error: passing 'const string' {aka 'const std::__cxx11::basic_string<char>'} as 'this' argument discards qualifiers [-fpermissive]
12 | a.erase(0, 3);
| ^
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 /in/foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:1811:7: note: in call to 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]'
1811 | erase(size_type __pos = 0, size_type __n = npos)
| ^~~~~
/in/foo.cc:15:17: error: passing 'const string' {aka 'const std::__cxx11::basic_string<char>'} as 'this' argument discards qualifiers [-fpermissive]
15 | b.erase(0, 5);
| ^
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 /in/foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:1811:7: note: in call to 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]'
1811 | erase(size_type __pos = 0, size_type __n = npos)
| ^~~~~
/in/foo.cc:17:17: error: passing 'const string' {aka 'const std::__cxx11::basic_string<char>'} as 'this' argument discards qualifiers [-fpermissive]
17 | b.erase(0, 3);
| ^
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 /in/foo.cc:1:
/usr/include/c++/9/bits/basic_string.h:1811:7: note: in call to 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]'
1811 | erase(size_type __pos = 0, size_type __n = npos)
| ^~~~~