Hmm... When I try and do as you suggested, I am getting a strange error. In Visual Studio 2013 express, I get an "error C2512: 'thor::ResourceKey<sf::Texture>': no appropriate default constructor available."
The output is:
1>------ Build started: Project: Hand and Foot, Configuration: Debug Win32 ------
1> Round.cpp
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\tuple(746): error C2512: 'thor::ResourceKey<sf::Texture>' : no appropriate default constructor available
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\tuple(762) : see reference to function template instantiation 'std::pair<const _Kty,_Ty>::pair<std::tuple<Round::TextureType &&>,std::tuple<>,0,>(_Tuple1 &,_Tuple2 &,std::_Arg_idx<0>,std::_Arg_idx<>)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> , _Tuple1=std::tuple<Round::TextureType &&>
1> , _Tuple2=std::tuple<>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\tuple(762) : see reference to function template instantiation 'std::pair<const _Kty,_Ty>::pair<std::tuple<Round::TextureType &&>,std::tuple<>,0,>(_Tuple1 &,_Tuple2 &,std::_Arg_idx<0>,std::_Arg_idx<>)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> , _Tuple1=std::tuple<Round::TextureType &&>
1> , _Tuple2=std::tuple<>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(600) : see reference to function template instantiation 'std::pair<const _Kty,_Ty>::pair<Round::TextureType&&,>(std::piecewise_construct_t,std::tuple<Round::TextureType &&>,std::tuple<>)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(600) : see reference to function template instantiation 'std::pair<const _Kty,_Ty>::pair<Round::TextureType&&,>(std::piecewise_construct_t,std::tuple<Round::TextureType &&>,std::tuple<>)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(723) : see reference to function template instantiation 'void std::allocator<_Other>::construct<_Objty,const std::piecewise_construct_t&,_Ty,std::tuple<>>(_Objty *,const std::piecewise_construct_t &,_Ty &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Other=std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>
1> , _Objty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> , _Ty=std::tuple<Round::TextureType &&>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(723) : see reference to function template instantiation 'void std::allocator<_Other>::construct<_Objty,const std::piecewise_construct_t&,_Ty,std::tuple<>>(_Objty *,const std::piecewise_construct_t &,_Ty &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Other=std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>
1> , _Objty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> , _Ty=std::tuple<Round::TextureType &&>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(872) : see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(std::allocator<_Other> &,_Objty *,const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Alloc=std::allocator<std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>>
1> , _Ty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> , _Other=std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>
1> , _Objty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(872) : see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(std::allocator<_Other> &,_Objty *,const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Alloc=std::allocator<std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>>
1> , _Ty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> , _Other=std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>
1> , _Objty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtree(933) : see reference to function template instantiation 'void std::_Wrap_alloc<std::allocator<_Other>>::construct<_Ty,const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(_Ty *,const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Other=std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>
1> , _Ty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtree(933) : see reference to function template instantiation 'void std::_Wrap_alloc<std::allocator<_Other>>::construct<_Ty,const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(_Ty *,const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Other=std::_Tree_node<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>,void *>
1> , _Ty=std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtree(1184) : see reference to function template instantiation 'std::_Tree_node<std::pair<const _Kty,_Ty>,void *> *std::_Tree_buy<std::pair<const _Kty,_Ty>,std::allocator<std::pair<const _Kty,_Ty>>>::_Buynode<const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtree(1184) : see reference to function template instantiation 'std::_Tree_node<std::pair<const _Kty,_Ty>,void *> *std::_Tree_buy<std::pair<const _Kty,_Ty>,std::allocator<std::pair<const _Kty,_Ty>>>::_Buynode<const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\map(181) : see reference to function template instantiation 'std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const _Kty,_Ty>>>> std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::emplace_hint<const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const _Kty,_Ty>>>>,const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> , _Pr=std::less<Round::TextureType>
1> , _Alloc=std::allocator<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\map(181) : see reference to function template instantiation 'std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const _Kty,_Ty>>>> std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::emplace_hint<const std::piecewise_construct_t&,std::tuple<Round::TextureType &&>,std::tuple<>>(std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const _Kty,_Ty>>>>,const std::piecewise_construct_t &,std::tuple<Round::TextureType &&> &&,std::tuple<> &&)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> , _Pr=std::less<Round::TextureType>
1> , _Alloc=std::allocator<std::pair<const Round::TextureType,thor::ResourceKey<sf::Texture>>>
1> ]
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\map(173) : while compiling class template member function 'thor::ResourceKey<sf::Texture> &std::map<Round::TextureType,thor::ResourceKey<sf::Texture>,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>::operator [](Round::TextureType &&)'
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
1> c:\users\jordan w\documents\visual studio 2013\projects\hand and foot - copy\hand and foot\round.cpp(51) : see reference to function template instantiation 'thor::ResourceKey<sf::Texture> &std::map<Round::TextureType,thor::ResourceKey<sf::Texture>,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>::operator [](Round::TextureType &&)' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
1> c:\users\jordan w\documents\visual studio 2013\projects\hand and foot - copy\hand and foot\round.h(62) : see reference to class template instantiation 'std::map<Round::TextureType,thor::ResourceKey<sf::Texture>,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' being compiled
1> with
1> [
1> _Kty=Round::TextureType
1> , _Ty=thor::ResourceKey<sf::Texture>
1> ]
The out put references two lines of code from my file.
Line 62 from Round.h, in the "private:" section:
std::map<TextureType, thor::ResourceKey<sf::Texture>> mKeys;
and line 51 from Round.cpp, in the function "buildScene()", which is called after "loadTextures()":
std::shared_ptr<sf::Texture> tableTexture = mTextures.search(mKeys[TextureType::Table]);
Any ideas what might be going on? I am running Windows 7, and have the libraries statically linked, if that is helpful information at all.