-
-
Save elextr/0cea1225e322a499af234f4e4a54b54a to your computer and use it in GitHub Desktop.
C++ example error message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
persistent.cpp: In function ‘size_t v2s(std::string&, int)’: | |
persistent.cpp:184:15: error: no matching function for call to ‘std::__cxx11::basic_string<char>::append(int&)’ | |
184 | s.append(v); | |
| ^ | |
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 persistent.cpp:25: | |
/usr/include/c++/9/bits/basic_string.h:1263:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ <near match> | |
1263 | append(const _CharT* __s) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1263:7: note: conversion of argument 1 would be ill-formed: | |
persistent.cpp:184:14: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive] | |
184 | s.append(v); | |
| ^ | |
| | | |
| int | |
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 persistent.cpp:25: | |
/usr/include/c++/9/bits/basic_string.h:1221:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ | |
1221 | append(const basic_string& __str) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1221:34: note: no known conversion for argument 1 from ‘int’ to ‘const std::__cxx11::basic_string<char>&’ | |
1221 | append(const basic_string& __str) | |
| ~~~~~~~~~~~~~~~~~~~~^~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1238:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, 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]’ | |
1238 | append(const basic_string& __str, size_type __pos, size_type __n = npos) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1238:7: note: candidate expects 3 arguments, 1 provided | |
/usr/include/c++/9/bits/basic_string.h:1250:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(const _CharT*, 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]’ | |
1250 | append(const _CharT* __s, size_type __n) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1250:7: note: candidate expects 2 arguments, 1 provided | |
/usr/include/c++/9/bits/basic_string.h:1280:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’ | |
1280 | append(size_type __n, _CharT __c) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1280:7: note: candidate expects 2 arguments, 1 provided | |
/usr/include/c++/9/bits/basic_string.h:1290:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ | |
1290 | append(initializer_list<_CharT> __l) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1290:39: note: no known conversion for argument 1 from ‘int’ to ‘std::initializer_list<char>’ | |
1290 | append(initializer_list<_CharT> __l) | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ | |
/usr/include/c++/9/bits/basic_string.h:1309:9: note: candidate: ‘template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::append(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ | |
1309 | append(_InputIterator __first, _InputIterator __last) | |
| ^~~~~~ | |
/usr/include/c++/9/bits/basic_string.h:1309:9: note: template argument deduction/substitution failed: | |
persistent.cpp:184:15: note: candidate expects 2 arguments, 1 provided | |
184 | s.append(v); | |
| ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment