would've been faster if you actually gave the error. For custom keys in maps, they should define operator< , or make a custom functor comparator and use that in third template parameter of map initialization.
Edit: the second, out-of-class, comparator functor option is harder to implement, because either the item you use for comparison would need to be public, or the comparator would need to be a friend and even then might get some errors as you fiddle around to fix constness and other issues.
Ok, thanks for the solution. The error was really weird, here is the error:
visual studio\2017\community\vc\tools\msvc\14.14.26428\include\unordered_map(133): error C2280: 'std::hash<_Kty>::hash(const std::hash<_Kty> &)': attempting to reference a deleted function
1> with
1> [
1> _Kty=TexturedModel
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\type_traits(2392): note: compiler has generated 'std::hash<_Kty>::hash' here
1> with
1> [
1> _Kty=TexturedModel
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\unordered_map(132): note: while compiling class template member function 'std::unordered_map<TexturedModel,std::vector<Entity,std::allocator<_Ty>>,std::hash<_Kty>,std::equal_to<_Kty>,std::allocator<std::pair<const _Kty,std::vector<_Ty,std::allocator<_Ty>>>>>::unordered_map(void)'
1> with
1> [
1> _Ty=Entity,
1> _Kty=TexturedModel
1> ]
1>c:\users\hassa\source\repos\c++\c++\src\main.cpp(12): note: see reference to function template instantiation 'std::unordered_map<TexturedModel,std::vector<Entity,std::allocator<_Ty>>,std::hash<_Kty>,std::equal_to<_Kty>,std::allocator<std::pair<const _Kty,std::vector<_Ty,std::allocator<_Ty>>>>>::unordered_map(void)' being compiled
1> with
1> [
1> _Ty=Entity,
1> _Kty=TexturedModel
1> ]
1>c:\users\hassa\source\repos\c++\c++\src\main.cpp(12): note: see reference to class template instantiation 'std::unordered_map<TexturedModel,std::vector<Entity,std::allocator<_Ty>>,std::hash<_Kty>,std::equal_to<_Kty>,std::allocator<std::pair<const _Kty,std::vector<_Ty,std::allocator<_Ty>>>>>' being compiled
1> with
1> [
1> _Ty=Entity,
1> _Kty=TexturedModel
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\type_traits(2392): note: 'std::hash<_Kty>::hash(const std::hash<_Kty> &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'std::_Conditionally_enabled_hash<_Kty,false>::_Conditionally_enabled_hash(const std::_Conditionally_enabled_hash<_Kty,false> &)'
1> with
1> [
1> _Kty=TexturedModel
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\type_traits(2376): note: 'std::_Conditionally_enabled_hash<_Kty,false>::_Conditionally_enabled_hash(const std::_Conditionally_enabled_hash<_Kty,false> &)': function was explicitly deleted
1> with