main1.cpp: In function 'int main()': main1.cpp:14:14: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string'} and 'int') 14 | cout << name + age << endl; | ~~~~ ^ ~~~ | | | | | int | std::string {aka std::__cxx11::basic_string} In file included from /usr/include/c++/12/string:47, from /usr/include/c++/12/bitset:47, from cmpslib19.h:4, from main1.cpp:3: /usr/include/c++/12/bits/stl_iterator.h:630:5: note: candidate: 'template constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 630 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/12/bits/stl_iterator.h:630:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/stl_iterator.h:1786:5: note: candidate: 'template constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1786 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/12/bits/stl_iterator.h:1786:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 14 | cout << name + age << endl; | ^~~ In file included from /usr/include/c++/12/string:53: /usr/include/c++/12/bits/basic_string.h:3432:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3432 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3432:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | cout << name + age << endl; | ^~~ In file included from /usr/include/c++/12/string:54: /usr/include/c++/12/bits/basic_string.tcc:606:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 606 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.tcc:606:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.tcc:627:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 627 | operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.tcc:627:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3472:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3472 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3472:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const _CharT*' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3489:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3489 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3489:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3502:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3502 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3502:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3509:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3509 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3509:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3516:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3516 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3516:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3539:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3539 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3539:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3546:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3546 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3546:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3553:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3553 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3553:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: mismatched types 'const _CharT*' and 'int' 14 | cout << name + age << endl; | ^~~ /usr/include/c++/12/bits/basic_string.h:3560:5: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3560 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/12/bits/basic_string.h:3560:5: note: template argument deduction/substitution failed: main1.cpp:14:16: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 14 | cout << name + age << endl; | ^~~