intro1.cc: In instantiation of ‘Type add(const Type&, const Type&) [with Type = std::unordered_map]’: intro1.cc:32:61: required from here intro1.cc:23:18: error: no match for ‘operator+’ (operand types are ‘const std::unordered_map’ and ‘const std::unordered_map’) return x + y; ~~^~~ In file included from /usr/include/c++/8/bits/stl_algobase.h:67, from /usr/include/c++/8/bits/char_traits.h:39, from /usr/include/c++/8/ios:40, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/stl_iterator.h:400:5: note: candidate: ‘template constexpr std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)’ operator+(typename reverse_iterator<_Iterator>::difference_type __n, ^~~~~~~~ /usr/include/c++/8/bits/stl_iterator.h:400:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::reverse_iterator<_Iterator>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/bits/stl_algobase.h:67, from /usr/include/c++/8/bits/char_traits.h:39, from /usr/include/c++/8/ios:40, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/stl_iterator.h:1195:5: note: candidate: ‘template constexpr std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)’ operator+(typename move_iterator<_Iterator>::difference_type __n, ^~~~~~~~ /usr/include/c++/8/bits/stl_iterator.h:1195:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::move_iterator<_IteratorL>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:5927:5: note: candidate: ‘template 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>&)’ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:5927:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:53, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.tcc:1157:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’ operator+(const _CharT* __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.tcc:1157:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: mismatched types ‘const _CharT*’ and ‘std::unordered_map’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:53, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.tcc:1173:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’ operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) ^~~~~~~~ /usr/include/c++/8/bits/basic_string.tcc:1173:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:5964:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)’ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:5964:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:5980:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)’ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:5980:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:5992:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’ operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:5992:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: types ‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ and ‘const std::unordered_map’ have incompatible cv-qualifiers return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:5998:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)’ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:5998:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:6004:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)’ operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:6004:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: types ‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ and ‘const std::unordered_map’ have incompatible cv-qualifiers return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:6016:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)’ operator+(const _CharT* __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:6016:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: mismatched types ‘const _CharT*’ and ‘std::unordered_map’ return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:6022:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)’ operator+(_CharT __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:6022:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: types ‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ and ‘const std::unordered_map’ have incompatible cv-qualifiers return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:6028:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)’ operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:6028:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: types ‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ and ‘const std::unordered_map’ have incompatible cv-qualifiers return x + y; ~~^~~ In file included from /usr/include/c++/8/string:52, from /usr/include/c++/8/bits/locale_classes.h:40, from /usr/include/c++/8/bits/ios_base.h:41, from /usr/include/c++/8/ios:42, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/basic_string.h:6034:5: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)’ operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, ^~~~~~~~ /usr/include/c++/8/bits/basic_string.h:6034:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: types ‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ and ‘const std::unordered_map’ have incompatible cv-qualifiers return x + y; ~~^~~ In file included from /usr/include/c++/8/vector:65, from intro1.cc:3: /usr/include/c++/8/bits/stl_bvector.h:299:3: note: candidate: ‘std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)’ operator+(ptrdiff_t __n, const _Bit_iterator& __x) ^~~~~~~~ /usr/include/c++/8/bits/stl_bvector.h:299:3: note: no known conversion for argument 1 from ‘const std::unordered_map’ to ‘std::ptrdiff_t’ {aka ‘long int’} /usr/include/c++/8/bits/stl_bvector.h:389:3: note: candidate: ‘std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)’ operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) ^~~~~~~~ /usr/include/c++/8/bits/stl_bvector.h:389:3: note: no known conversion for argument 1 from ‘const std::unordered_map’ to ‘std::ptrdiff_t’ {aka ‘long int’} In file included from /usr/include/c++/8/bits/stl_algobase.h:67, from /usr/include/c++/8/bits/char_traits.h:39, from /usr/include/c++/8/ios:40, from /usr/include/c++/8/ostream:38, from /usr/include/c++/8/iostream:39, from intro1.cc:1: /usr/include/c++/8/bits/stl_iterator.h:973:5: note: candidate: ‘template __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)’ operator+(typename __normal_iterator<_Iterator, _Container>::difference_type ^~~~~~~~ /usr/include/c++/8/bits/stl_iterator.h:973:5: note: template argument deduction/substitution failed: intro1.cc:23:18: note: ‘const std::unordered_map’ is not derived from ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ return x + y; ~~^~~