fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. using IntPair = pair<int,int>;
  8.  
  9. unordered_map<IntPair,int> p;
  10. //p[{1,2}] = 1;
  11.  
  12. //cout<<p[{1,2}];
  13. return 1;
  14. }
Compilation error #stdin compilation error #stdout 0s 4188KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable.h: In instantiation of ‘class std::_Hashtable<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::allocator<std::pair<const std::pair<int, int>, int> >, std::__detail::_Select1st, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >’:
/usr/include/c++/8/bits/unordered_map.h:105:18:   required from ‘class std::unordered_map<std::pair<int, int>, int>’
prog.cpp:9:29:   required from here
/usr/include/c++/8/bits/hashtable.h:195:21: error: static assertion failed: hash function must be invocable with an argument of key type
       static_assert(__is_invocable<const _H1&, const _Key&>{},
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:9:29: error: use of deleted function ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]’
  unordered_map<IntPair,int> p;
                             ^
In file included from /usr/include/c++/8/unordered_map:47,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/unordered_map.h:141:7: note: ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]’ is implicitly deleted because the default definition would be ill-formed:
       unordered_map() = default;
       ^~~~~~~~~~~~~
/usr/include/c++/8/bits/unordered_map.h:141:7: error: use of deleted function ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’
In file included from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable.h:413:7: note: ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’ is implicitly deleted because the default definition would be ill-formed:
       _Hashtable() = default;
       ^~~~~~~~~~
/usr/include/c++/8/bits/hashtable.h:413:7: error: use of deleted function ‘std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’
In file included from /usr/include/c++/8/bits/hashtable.h:35,
                 from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable_policy.h:1824:5: note: ‘std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’ is implicitly deleted because the default definition would be ill-formed:
     _Hashtable_base() = default;
     ^~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1824:5: error: use of deleted function ‘std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing]’
/usr/include/c++/8/bits/hashtable_policy.h:1379:7: note: ‘std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing]’ is implicitly deleted because the default definition would be ill-formed:
       _Hash_code_base() = default;
       ^~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1379:7: error: use of deleted function ‘std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<int, int> >]’
/usr/include/c++/8/bits/hashtable_policy.h:1106:7: note: ‘std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<int, int> >]’ is implicitly deleted because the default definition would be ill-formed:
       _Hashtable_ebo_helper() = default;
       ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1106:7: error: use of deleted function ‘std::hash<std::pair<int, int> >::hash()’
In file included from /usr/include/c++/8/bits/basic_string.h:6626,
                 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 prog.cpp:1:
/usr/include/c++/8/bits/functional_hash.h:101:12: note: ‘std::hash<std::pair<int, int> >::hash()’ is implicitly deleted because the default definition would be ill-formed:
     struct hash : __hash_enum<_Tp>
            ^~~~
/usr/include/c++/8/bits/functional_hash.h:101:12: error: no matching function for call to ‘std::__hash_enum<std::pair<int, int>, false>::__hash_enum()’
/usr/include/c++/8/bits/functional_hash.h:82:7: note: candidate: ‘std::__hash_enum<_Tp, <anonymous> >::__hash_enum(std::__hash_enum<_Tp, <anonymous> >&&) [with _Tp = std::pair<int, int>; bool <anonymous> = false]’
       __hash_enum(__hash_enum&&);
       ^~~~~~~~~~~
/usr/include/c++/8/bits/functional_hash.h:82:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/8/bits/functional_hash.h:101:12: error: ‘std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<int, int>; bool <anonymous> = false]’ is private within this context
     struct hash : __hash_enum<_Tp>
            ^~~~
/usr/include/c++/8/bits/functional_hash.h:83:7: note: declared private here
       ~__hash_enum();
       ^
In file included from /usr/include/c++/8/bits/hashtable.h:35,
                 from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable_policy.h:1106:7: error: use of deleted function ‘std::hash<std::pair<int, int> >::~hash()’
       _Hashtable_ebo_helper() = default;
       ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/bits/basic_string.h:6626,
                 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 prog.cpp:1:
/usr/include/c++/8/bits/functional_hash.h:101:12: note: ‘std::hash<std::pair<int, int> >::~hash()’ is implicitly deleted because the default definition would be ill-formed:
     struct hash : __hash_enum<_Tp>
            ^~~~
/usr/include/c++/8/bits/functional_hash.h:101:12: error: ‘std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<int, int>; bool <anonymous> = false]’ is private within this context
/usr/include/c++/8/bits/functional_hash.h:83:7: note: declared private here
       ~__hash_enum();
       ^
In file included from /usr/include/c++/8/bits/hashtable.h:35,
                 from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable_policy.h:1379:7: error: use of deleted function ‘std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<int, int> >, true>::~_Hashtable_ebo_helper()’
       _Hash_code_base() = default;
       ^~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1103:12: note: ‘std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<int, int> >, true>::~_Hashtable_ebo_helper()’ is implicitly deleted because the default definition would be ill-formed:
     struct _Hashtable_ebo_helper<_Nm, _Tp, true>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1103:12: error: use of deleted function ‘std::hash<std::pair<int, int> >::~hash()’
/usr/include/c++/8/bits/hashtable_policy.h:1824:5: error: use of deleted function ‘std::__detail::_Hash_code_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()’
     _Hashtable_base() = default;
     ^~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1352:12: note: ‘std::__detail::_Hash_code_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()’ is implicitly deleted because the default definition would be ill-formed:
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       _Default_ranged_hash, true>
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1352:12: error: use of deleted function ‘std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<int, int> >, true>::~_Hashtable_ebo_helper()’
In file included from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable.h:413:7: error: use of deleted function ‘std::__detail::_Hashtable_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::~_Hashtable_base()’
       _Hashtable() = default;
       ^~~~~~~~~~
In file included from /usr/include/c++/8/bits/hashtable.h:35,
                 from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable_policy.h:1772:10: note: ‘std::__detail::_Hashtable_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::~_Hashtable_base()’ is implicitly deleted because the default definition would be ill-formed:
   struct _Hashtable_base
          ^~~~~~~~~~~~~~~
/usr/include/c++/8/bits/hashtable_policy.h:1772:10: error: use of deleted function ‘std::__detail::_Hash_code_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()’
In file included from /usr/include/c++/8/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:117,
                 from prog.cpp:2:
/usr/include/c++/8/bits/hashtable.h: In instantiation of ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::~_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’:
/usr/include/c++/8/bits/unordered_map.h:102:11:   required from here
/usr/include/c++/8/bits/hashtable.h:1376:5: error: use of deleted function ‘std::__detail::_Hashtable_base<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::__detail::_Select1st, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::~_Hashtable_base()’
     }
     ^
stdout
Standard output is empty